]> granicus.if.org Git - php/commitdiff
- Fix leak
authorZeev Suraski <zeev@php.net>
Tue, 5 Sep 2000 21:18:00 +0000 (21:18 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 5 Sep 2000 21:18:00 +0000 (21:18 +0000)
- Remove redundant php_ini code

ext/session/session.c
main/php_ini.c

index 455fd11296d54a423522802212e2213b440cba27..2c9b5cc5a6c2eab4037144b585601035d62ba05c 100644 (file)
@@ -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;
 }
index dc5ebf1e24fca19a5977d282b1503ba671d1b7fc..6f4c870d1f8cb96b25de20c75520010c4db066a7 100644 (file)
@@ -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;