summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2006-11-12 00:31:03 +0000
committerNuno Lopes <nlopess@php.net>2006-11-12 00:31:03 +0000
commitc0b0d0a81a7d5c1ca150068179911473af2f0069 (patch)
tree79ed52ab9fc31e4abc450a919df6cbfe5d78eb69 /ext/zip/php_zip.c
parent232bb79bedd276d5a1510ad849e952a056a08c05 (diff)
downloadphp-git-c0b0d0a81a7d5c1ca150068179911473af2f0069.tar.gz
fix leak in the object destrucotr when zip_close() fails (fixes oo_delete.phpt)
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 03c13ddc78..b7591b81d2 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -490,7 +490,9 @@ static void php_zip_object_free_storage(void *object TSRMLS_DC) /* {{{ */
return;
}
if (intern->za) {
- zip_close(intern->za);
+ if (zip_close(intern->za) != 0) {
+ _zip_free(intern->za);
+ }
intern->za = NULL;
}