com php-src: Fixed memory leak: ZendAccelerator.c
| From: | Dmitry Stogov | Date: | Fri, 22 Feb 2013 13:22:43 +0000 |
| Subject: | com php-src: Fixed memory leak: ZendAccelerator.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71514@lists.php.net to get a copy of this message | ||
Commit: 4fe4b0d593de9ed192eb8bc09d0089a56aebda43
Author: Dmitry Stogov <dmitry@zend.com> Fri, 22 Feb 2013 17:22:43 +0400
Parents: f2e8465017868f9f983afbf5eac6a4cc01ad0a48
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4fe4b0d593de9ed192eb8bc09d0089a56aebda43
Log:
Fixed memory leak
Changed paths:
M ZendAccelerator.c
Diff:
diff --git a/ZendAccelerator.c b/ZendAccelerator.c
index d3c3b14..c7ed496 100644
--- a/ZendAccelerator.c
+++ b/ZendAccelerator.c
@@ -146,6 +146,9 @@ static ZEND_FUNCTION(accel_chdir)
orig_chdir(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ if (ZCG(cwd)) {
+ efree(ZCG(cwd));
+ }
ZCG(cwd_len) = strlen(cwd);
ZCG(cwd) = estrndup(cwd, ZCG(cwd_len));
} else {