mirror of
https://github.com/php/php-src.git
synced 2024-12-11 10:54:47 +08:00
- Fix possible memory leak
This commit is contained in:
parent
85a622e42f
commit
420068c6e1
@ -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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user