From: Nikita Popov Date: Wed, 11 Mar 2015 14:26:33 +0000 (+0100) Subject: Fix some memory leaks in WebPhar X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~702 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c532376ee78342fb170c5d2b7784b3ab79491494;p=php Fix some memory leaks in WebPhar --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 69bda4bab3..e276613209 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -819,6 +819,11 @@ PHP_METHOD(Phar, webPhar) code = Z_LVAL_P(val); } else { zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed"); + if (free_pathinfo) { + efree(path_info); + } + efree(pt); + efree(entry); #ifdef PHP_WIN32 efree(fname); #endif @@ -831,6 +836,11 @@ PHP_METHOD(Phar, webPhar) break; default: zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed"); + if (free_pathinfo) { + efree(path_info); + } + efree(pt); + efree(entry); #ifdef PHP_WIN32 efree(fname); #endif