com php-src: Fixed memory leak in ext/standard/tests/strings/bug24098.phpt: ext/standard/string.c
| From: | Dmitry Stogov | Date: | Mon, 24 Feb 2014 08:14:46 +0000 |
| Subject: | com php-src: Fixed memory leak in ext/standard/tests/strings/bug24098.phpt: ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77966@lists.php.net to get a copy of this message | ||
Commit: 6c3c1f0949a33dc948b388535678288612e0f526
Author: Xinchen Hui <laruence@gmail.com> Mon, 24 Feb 2014 16:14:46 +0800
Parents: 4dac68221ff731717c5223bbb748400d12f40953
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c3c1f0949a33dc948b388535678288612e0f526
Log:
Fixed memory leak in ext/standard/tests/strings/bug24098.phpt
Bugs:
https://bugs.php.net/24098
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index c834130..6d81fbf 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1521,7 +1521,7 @@ PHP_FUNCTION(pathinfo)
char *path, *dirname;
int path_len, have_basename;
long opt = PHP_PATHINFO_ALL;
- zend_string *ret;
+ zend_string *ret = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len,
&opt) == FAILURE) {
return;
@@ -1576,7 +1576,7 @@ PHP_FUNCTION(pathinfo)
add_assoc_stringl(&tmp, "filename", ret->val, idx, 1);
}
- if (!have_basename && ret) {
+ if (ret) {
STR_RELEASE(ret);
}