FPM: Fix possible double free on configuration load failure.

Closes #8948.
This commit is contained in:
Heiko Weber 2022-07-07 15:51:09 +02:00 committed by David Carlier
parent 2e58e9e60f
commit bd6793372b
2 changed files with 5 additions and 1 deletions

1
NEWS
View file

@ -12,6 +12,7 @@ PHP NEWS
- FPM:
. Fixed zlog message prepend, free on incorrect address. (Heiko Weber)
. Fixed possible double free on configuration loading failure. (Heiko Weber).
- GD:
. Fixed bug GH-8848 (imagecopyresized() error refers to the wrong argument).

View file

@ -1622,7 +1622,10 @@ int fpm_conf_load_ini_file(char *filename) /* {{{ */
tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error);
ini_filename = filename;
if (error || tmp == FAILURE) {
if (ini_include) free(ini_include);
if (ini_include) {
free(ini_include);
ini_include = NULL;
}
ini_recursion--;
close(fd);
free(buf);