We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85a622e commit 420068cCopy full SHA for 420068c
ext/zip/php_zip.c
@@ -1856,15 +1856,16 @@ static ZIPARCHIVE_METHOD(addFromString)
1856
/* TODO: fix _zip_replace */
1857
if (cur_idx >= 0) {
1858
if (zip_delete(intern, cur_idx) == -1) {
1859
- RETURN_FALSE;
+ goto fail;
1860
}
1861
1862
1863
- if (zip_add(intern, name, zs) == -1) {
1864
1865
- } else {
+ if (zip_add(intern, name, zs) != -1) {
1866
RETURN_TRUE;
1867
+fail:
+ zip_source_free(zs);
1868
+ RETURN_FALSE;
1869
1870
/* }}} */
1871
0 commit comments