summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2013-10-20 01:05:06 -0200
committerFelipe Pena <felipensp@gmail.com>2013-10-20 01:05:06 -0200
commit84011f7c326ff6a10585b2a260a31877eb40ce5b (patch)
treea45a9e152ff1b71974091e903e109c0ba6e98d4c /ext/zip/php_zip.c
parent39e746a4249e34bc9028ff5d7540cd344181293d (diff)
parent8d22c231617cafba3a34a490036cccb31a393d70 (diff)
downloadphp-git-84011f7c326ff6a10585b2a260a31877eb40ce5b.tar.gz
Merge branch 'PHP-5.5'
* PHP-5.5: - Fix possible memory leak
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 969bac1aa6..e69ef30bb3 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1856,15 +1856,16 @@ static ZIPARCHIVE_METHOD(addFromString)
/* TODO: fix _zip_replace */
if (cur_idx >= 0) {
if (zip_delete(intern, cur_idx) == -1) {
- RETURN_FALSE;
+ goto fail;
}
}
- if (zip_add(intern, name, zs) == -1) {
- RETURN_FALSE;
- } else {
+ if (zip_add(intern, name, zs) != -1) {
RETURN_TRUE;
}
+fail:
+ zip_source_free(zs);
+ RETURN_FALSE;
}
/* }}} */