From: Ilia Alshanetsky Date: Sun, 7 Jan 2007 03:12:14 +0000 (+0000) Subject: Fixed memory leaks on error X-Git-Tag: php-5.2.1RC3~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbf6f5b53839dd72170b8e766fdc7fa0fca5dabe;p=php Fixed memory leaks on error --- diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 21291c0133..4f63d74d53 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -689,6 +689,7 @@ static PHP_FUNCTION(zip_read) rsrc_int->index_current++; ZEND_REGISTER_RESOURCE(return_value, zr_rsrc, le_zip_entry); } else { + efree(zr_rsrc); RETURN_FALSE; } @@ -770,6 +771,7 @@ static PHP_FUNCTION(zip_entry_read) buffer[n] = 0; RETURN_STRINGL(buffer, n, 0); } else { + efree(buffer); RETURN_EMPTY_STRING() } } else { @@ -1815,6 +1817,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ buffer = safe_emalloc(len, 1, 2); n = zip_fread(zf, buffer, len); if (n < 1) { + efree(buffer); RETURN_EMPTY_STRING(); }