com php-src: Fix some memory leaks in WebPhar: ext/phar/phar_ object.c
| From: | Nikita Popov | Date: | Wed, 11 Mar 2015 14:27:42 +0000 |
| Subject: | com php-src: Fix some memory leaks in WebPhar: ext/phar/phar_ object.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85462@lists.php.net to get a copy of this message | ||
Commit: c532376ee78342fb170c5d2b7784b3ab79491494
Author: Nikita Popov <nikic@php.net> Wed, 11 Mar 2015 15:26:33 +0100
Parents: d68861eb4b680e3aa0c4c6bafcab7be4bc36f622
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c532376ee78342fb170c5d2b7784b3ab79491494
Log:
Fix some memory leaks in WebPhar
Changed paths:
M ext/phar/phar_object.c
Diff:
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 69bda4b..e276613 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