summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--mod_php4.c12
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 80f9f3ca64..2358c3f4aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ PHP 4.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
+- Fixed a memory leak in the Apache per-directory directives handler (Zeev)
- Added array_count_values() function. (Thies)
- snmp, pgsql, mysql and gd modules can be built as dynamically loaded
modules (Greg)
diff --git a/mod_php4.c b/mod_php4.c
index 1d78fa0e58..579287dbf3 100644
--- a/mod_php4.c
+++ b/mod_php4.c
@@ -362,16 +362,20 @@ static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry)
per_dir_entry->value[per_dir_entry->value_length] = 0;
}
-/*
- * Create the per-directory config structure with defaults
- */
+
+static void php_destroy_per_dir_info(HashTable *per_dir_info)
+{
+ zend_hash_destroy(per_dir_info);
+ free(per_dir_info);
+}
+
static void *php_create_dir(pool *p, char *dummy)
{
HashTable *per_dir_info;
per_dir_info = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init(per_dir_info, 5, NULL, (int (*)(void *)) destroy_per_dir_entry, 1);
- register_cleanup(p, (void *) per_dir_info, (void (*)(void *)) zend_hash_destroy, (void (*)(void *)) zend_hash_destroy);
+ register_cleanup(p, (void *) per_dir_info, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) zend_hash_destroy);
return per_dir_info;
}