summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 4b76954568..473a074231 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1151,6 +1151,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 */
@@ -1178,6 +1179,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':