From 7d75155e01a926d222843894a7b06e24378b02fd Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 12 Nov 2006 00:41:16 +0000 Subject: [PATCH] fix leak in oo_stream.phpt --- ext/zip/zip_stream.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index dd5374edd8..83e9ceab3e 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -60,9 +60,15 @@ static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t coun static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC) { STREAM_DATA_FROM_STREAM(); - if (close_handle && self->za) { - zip_close(self->za); - self->za = NULL; + if (close_handle) { + if (self->za) { + zip_close(self->za); + self->za = NULL; + } + if (self->zf) { + zip_fclose(self->zf); + self->zf = NULL; + } } efree(self); stream->abstract = NULL; -- 2.40.0