cvs: php4 /ext/session session.c /main php_ini.c
| From: | Zeev Suraski | Date: | Tue, 05 Sep 2000 21:18:00 +0000 |
| Subject: | cvs: php4 /ext/session session.c /main php_ini.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1593@lists.php.net to get a copy of this message | ||
zeev Tue Sep 5 14:18:00 2000 EDT
Modified files:
/php4/ext/session session.c
/php4/main php_ini.c
Log:
- Fix leak
- Remove redundant php_ini code
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.162 php4/ext/session/session.c:1.163
--- php4/ext/session/session.c:1.162 Tue Sep 5 12:29:03 2000
+++ php4/ext/session/session.c Tue Sep 5 14:17:59 2000
@@ -108,12 +108,12 @@
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: php4/main/php_ini.c
diff -u php4/main/php_ini.c:1.38 php4/main/php_ini.c:1.39
--- php4/main/php_ini.c:1.38 Mon Aug 21 02:50:53 2000
+++ php4/main/php_ini.c Tue Sep 5 14:18:00 2000
@@ -124,9 +124,6 @@
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 @@
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;