File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -432,27 +432,27 @@ static char* get_env_location(const char *envname)
432
432
size = GetEnvironmentVariableA (envname , & dummybuf , 0 );
433
433
if (GetLastError () == ERROR_ENVVAR_NOT_FOUND ) {
434
434
/* The environment variable doesn't exist. */
435
- return "" ;
435
+ return NULL ;
436
436
}
437
437
438
438
if (size == 0 ) {
439
- return "" ;
439
+ return NULL ;
440
440
}
441
441
442
442
size = GetEnvironmentVariableA (envname , phprc_path , size );
443
443
if (size == 0 ) {
444
- return "" ;
444
+ return NULL ;
445
445
}
446
446
447
447
env_location = phprc_path ;
448
448
}
449
449
#else
450
450
if (!env_location ) {
451
- return "" ;
451
+ return NULL ;
452
452
}
453
453
#endif
454
454
455
- return env_location ;
455
+ return estrdup ( env_location ) ;
456
456
}
457
457
/* }}} */
458
458
@@ -520,6 +520,10 @@ int php_init_config(void)
520
520
php_ini_file_name = env_location ;
521
521
}
522
522
523
+ if (env_location ) {
524
+ efree (env_location );
525
+ }
526
+
523
527
#ifdef PHP_WIN32
524
528
/* Add registry location */
525
529
reg_location = GetIniPathFromRegistry ();
You can’t perform that action at this time.
0 commit comments