mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
MFB:- Fix a possible leak when multiple -c parameters are used
This commit is contained in:
parent
39ac7bf0b7
commit
c19178d966
1 changed files with 4 additions and 0 deletions
|
@ -1106,6 +1106,7 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
|
||||
sapi_startup(&cgi_sapi_module);
|
||||
cgi_sapi_module.php_ini_path_override = NULL;
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
_fmode = _O_BINARY; /* sets default for file streams to binary */
|
||||
|
@ -1128,6 +1129,9 @@ int main(int argc, char *argv[])
|
|||
while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0)) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
if (cgi_sapi_module.php_ini_path_override) {
|
||||
free(cgi_sapi_module.php_ini_path_override);
|
||||
}
|
||||
cgi_sapi_module.php_ini_path_override = strdup(php_optarg);
|
||||
break;
|
||||
case 'n':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue