com php-src: fix memleak: ext/standard/string.c
| From: | Remi Collet | Date: | Mon, 27 Jul 2015 14:57:38 +0000 |
| Subject: | com php-src: fix memleak: ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88184@lists.php.net to get a copy of this message | ||
Commit: 80edd4038397395412e346b53f4e5279a3c39c11
Author: Remi Collet <remi@php.net> Mon, 27 Jul 2015 16:56:53 +0200
Parents: 248ebf0df69f61f5538df44d3565893935b784c5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=80edd4038397395412e346b53f4e5279a3c39c11
Log:
fix memleak
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 27b9de9..a39105e 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1668,6 +1668,7 @@ PHP_FUNCTION(dirname)
ZSTR_LEN(ret) = zend_dirname(ZSTR_VAL(ret), str_len);
} else if (levels < 1) {
php_error_docref(NULL, E_WARNING, "Invalid argument, levels must be >= 1");
+ zend_string_free(ret);
return;
} else {
/* Some levels up */