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.
This commit is contained in:
@@ -73,6 +73,9 @@ struct archive_plugin {
|
||||
/**
|
||||
* Opens an input_stream of a file within the archive.
|
||||
*
|
||||
* If this function succeeds, then the #input_stream "owns"
|
||||
* the archive file and will automatically close it.
|
||||
*
|
||||
* @param path the path within the archive
|
||||
*/
|
||||
bool (*open_stream)(struct archive_file *, struct input_stream *is,
|
||||
|
||||
Reference in New Issue
Block a user