1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

Fixed memory leak in ext/standard/tests/strings/bug24098.phpt

This commit is contained in:
Xinchen Hui
2014-02-24 16:14:46 +08:00
parent 4dac68221f
commit 6c3c1f0949
+2 -2
View File
@@ -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);
}