From 3411f6cffdcf3c72e7cee3a263c40414dfef956e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Dec 2009 19:45:50 +0100 Subject: archive: close archive when stream is closed Fixes a memory leak: the "archive" input plugin opens the archive, but never closes it. This patch moves the responsibility for doing that to archive_plugin.open_stream(). This is an slight internal API change, but it is the simplest and least intrusive fix for the memory leak. --- src/archive/bz2_plugin.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/archive/bz2_plugin.c') diff --git a/src/archive/bz2_plugin.c b/src/archive/bz2_plugin.c index 78f13400a..0ef042e90 100644 --- a/src/archive/bz2_plugin.c +++ b/src/archive/bz2_plugin.c @@ -173,6 +173,8 @@ bz2_is_close(struct input_stream *is) bz2_context *context = (bz2_context *) is->data; bz2_destroy(context); is->data = NULL; + + bz2_close((struct archive_file *)context); } static int -- cgit v1.2.3