Skip to content

Commit a8368dd

Browse files
committed
Fixed bug #70431 (Memory leak in php_ini.c)
1 parent 66643f6 commit a8368dd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
17 Sep 2015, PHP 7.0.0 RC 3
44

5+
- Core:
6+
. Fixed bug #70431 (Memory leak in php_ini.c). (Sixed, Laruence)
7+
58
- CLI server:
69
. Fixed bug #68291 (404 on urls with '+'). (cmb)
710

main/php_ini.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ int php_init_config(void)
553553
fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r");
554554
if (fh.handle.fp) {
555555
fh.filename = expand_filepath(php_ini_file_name, NULL);
556-
opened_path = zend_string_init(fh.filename, strlen(fh.filename), 0);
557556
}
558557
}
559558
}
@@ -599,6 +598,8 @@ int php_init_config(void)
599598
zend_hash_str_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path")-1, &tmp);
600599
if (opened_path) {
601600
zend_string_release(opened_path);
601+
} else {
602+
efree((char *)fh.filename);
602603
}
603604
php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
604605
}

0 commit comments

Comments
 (0)