]> granicus.if.org Git - php/commitdiff
Allocating hash tables should be done via macro, not directly
authorSara Golemon <pollita@php.net>
Mon, 13 Sep 2004 21:07:22 +0000 (21:07 +0000)
committerSara Golemon <pollita@php.net>
Mon, 13 Sep 2004 21:07:22 +0000 (21:07 +0000)
main/streams/filter.c
main/streams/streams.c

index cc6e62292fd945c17c71ca28be483cb82f818306..da61c714fac8a5977d09f4ac61193c1c1ef4935c 100644 (file)
@@ -60,7 +60,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern
        if (!FG(stream_filters)) {
                php_stream_filter_factory tmpfactory;
 
-               FG(stream_filters) = emalloc(sizeof(HashTable));
+               ALLOC_HASHTABLE(FG(stream_filters));
                zend_hash_init(FG(stream_filters), 0, NULL, NULL, 1);
                zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL, &tmpfactory, sizeof(php_stream_filter_factory));
        }
index dfe54fc55030db06466b3c71761da09a8a477f6d..bb2b137c3281799e57852cc939221d30f28114f6 100755 (executable)
@@ -1414,7 +1414,7 @@ PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_w
        if (!FG(stream_wrappers)) {
                php_stream_wrapper tmpwrapper;
 
-               FG(stream_wrappers) = emalloc(sizeof(HashTable));
+               ALLOC_HASHTABLE(FG(stream_wrappers));
                zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1);
                zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmpwrapper, sizeof(php_stream_wrapper));
        }
@@ -1427,7 +1427,7 @@ PHPAPI int php_unregister_url_stream_wrapper_volatile(char *protocol TSRMLS_DC)
        if (!FG(stream_wrappers)) {
                php_stream_wrapper tmpwrapper;
 
-               FG(stream_wrappers) = emalloc(sizeof(HashTable));
+               ALLOC_HASHTABLE(FG(stream_wrappers));
                zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1);
                zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmpwrapper, sizeof(php_stream_wrapper));
        }