- Fix possible memory leak

This commit is contained in:
Felipe Pena 2013-10-20 01:04:55 -02:00
parent 85a622e42f
commit 420068c6e1

View File

@ -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;
}
/* }}} */