Skip to content

Commit bd67933

Browse files
hwdedevnexen
authored andcommitted
FPM: Fix possible double free on configuration load failure.
Closes #8948.
1 parent 2e58e9e commit bd67933

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PHP NEWS
1212

1313
- FPM:
1414
. Fixed zlog message prepend, free on incorrect address. (Heiko Weber)
15+
. Fixed possible double free on configuration loading failure. (Heiko Weber).
1516

1617
- GD:
1718
. Fixed bug GH-8848 (imagecopyresized() error refers to the wrong argument).

sapi/fpm/fpm/fpm_conf.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,10 @@ int fpm_conf_load_ini_file(char *filename) /* {{{ */
16221622
tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error);
16231623
ini_filename = filename;
16241624
if (error || tmp == FAILURE) {
1625-
if (ini_include) free(ini_include);
1625+
if (ini_include) {
1626+
free(ini_include);
1627+
ini_include = NULL;
1628+
}
16261629
ini_recursion--;
16271630
close(fd);
16281631
free(buf);

0 commit comments

Comments
 (0)