From: Zeev Suraski Date: Tue, 5 Sep 2000 21:18:00 +0000 (+0000) Subject: - Fix leak X-Git-Tag: php-4.0.3RC1~288 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12adebbc3a2972a7cbbf9662fd69edb9c854a8f6;p=php - Fix leak - Remove redundant php_ini code --- diff --git a/ext/session/session.c b/ext/session/session.c index 455fd11296..2c9b5cc5a6 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -108,12 +108,12 @@ static PHP_INI_MH(OnUpdateStringCopy) p = (char **) (base+(size_t) mh_arg1); - if(*p && stage != PHP_INI_STAGE_STARTUP) { + if (*p && entry->modified) { STR_FREE(*p); } - if(stage != PHP_INI_STAGE_DEACTIVATE) { - *p = estrdup(new_value); + if (stage != PHP_INI_STAGE_DEACTIVATE) { + *p = estrdup(new_value); } return SUCCESS; } diff --git a/main/php_ini.c b/main/php_ini.c index dc5ebf1e24..6f4c870d1f 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -124,9 +124,6 @@ PHPAPI int php_register_ini_entries(php_ini_entry *ini_entry, int module_number) php_unregister_ini_entries(module_number); return FAILURE; } - if (hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP); - } if ((default_value=cfg_get_entry(p->name, p->name_length))) { if (!hashed_ini_entry->on_modify || hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP)==SUCCESS) { @@ -138,7 +135,6 @@ PHPAPI int php_register_ini_entries(php_ini_entry *ini_entry, int module_number) hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, PHP_INI_STAGE_STARTUP); } } - hashed_ini_entry->modified = 0; p++; } return SUCCESS;