diff --git a/test/T750-gzip.sh b/test/T750-gzip.sh index 5b678fa1..fac41d39 100755 --- a/test/T750-gzip.sh +++ b/test/T750-gzip.sh @@ -167,4 +167,11 @@ This is just a test message (#7) EOF test_expect_equal_file EXPECTED OUTPUT +# there are more than 200 messages in this corpus +add_email_corpus lkml +test_begin_subtest "new doesn't run out of file descriptors with many gzipped files" +ulimit -n 200 +gzip --recursive ${MAIL_DIR} +test_expect_success "notmuch new" + test_done diff --git a/util/gmime-extra.c b/util/gmime-extra.c index b515d126..04d8ed3d 100644 --- a/util/gmime-extra.c +++ b/util/gmime-extra.c @@ -29,6 +29,8 @@ _gzfile_maybe_filter (GMimeStream *file_stream) /* ignore filter id */ (void) g_mime_stream_filter_add ((GMimeStreamFilter *) gzstream, gzfilter); + g_object_unref (gzfilter); + g_object_unref (file_stream); return gzstream; } else { return file_stream;