diff options
author | Xinchen Hui <laruence@gmail.com> | 2015-09-10 19:53:37 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2015-09-10 19:56:13 +0800 |
commit | a8368ddc38a1940e705914699478dd1f83e745ee (patch) | |
tree | 10932e32fe91bb2843929e6c93c3982300c5e0b6 /main/php_ini.c | |
parent | 66643f6192749860a1b17d9dc9b69f98dcfe5256 (diff) | |
download | php-git-a8368ddc38a1940e705914699478dd1f83e745ee.tar.gz |
Fixed bug #70431 (Memory leak in php_ini.c)
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index ac79e60879..67434d6365 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -553,7 +553,6 @@ int php_init_config(void) fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r"); if (fh.handle.fp) { fh.filename = expand_filepath(php_ini_file_name, NULL); - opened_path = zend_string_init(fh.filename, strlen(fh.filename), 0); } } } @@ -599,6 +598,8 @@ int php_init_config(void) zend_hash_str_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path")-1, &tmp); if (opened_path) { zend_string_release(opened_path); + } else { + efree((char *)fh.filename); } php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); } |