summaryrefslogtreecommitdiff
path: root/mod_php4.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-09-20 11:54:06 +0000
committerZeev Suraski <zeev@php.net>1999-09-20 11:54:06 +0000
commitee382ca76ae9fe8e9e05cc745359b52923cd861b (patch)
tree44c2de4616de2ca45cbcabb37a127a57804508b1 /mod_php4.c
parent4bb329eafba6d1d8bc5148a43efbb611f5d672ca (diff)
downloadphp-git-ee382ca76ae9fe8e9e05cc745359b52923cd861b.tar.gz
Fixed a memory leak in the Apache per-directory directives handler
Diffstat (limited to 'mod_php4.c')
-rw-r--r--mod_php4.c12
1 files changed, 8 insertions, 4 deletions
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;
}