com php-src: Fixed memory leak: ext/standard/basic_functions .c
| From: | Dmitry Stogov | Date: | Fri, 11 Apr 2014 14:15:53 +0000 |
| Subject: | com php-src: Fixed memory leak: ext/standard/basic_functions .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77417@lists.php.net to get a copy of this message | ||
Commit: a6123151c7e67bc8355fa985182267aa4acb6bcc
Author: Dmitry Stogov <dmitry@zend.com> Fri, 11 Apr 2014 18:15:53 +0400
Parents: 13f0c8b18c704bfcd339a56e50d54d1bc22a08d5
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a6123151c7e67bc8355fa985182267aa4acb6bcc
Log:
Fixed memory leak
Changed paths:
M ext/standard/basic_functions.c
Diff:
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 2102986..0f212a5 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4031,7 +4031,9 @@ PHP_FUNCTION(getenv)
ptr = sapi_getenv(str, str_len TSRMLS_CC);
if (ptr) {
//??? RETURN_STRING(ptr, 0);
- RETURN_STRING(ptr);
+ RETVAL_STRING(ptr);
+ efree(ptr);
+ return;
}
#ifdef PHP_WIN32
{