From: Sara Golemon Date: Mon, 13 Sep 2004 21:07:22 +0000 (+0000) Subject: Allocating hash tables should be done via macro, not directly X-Git-Tag: PRE_NEW_VM_GEN_PATCH~312 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cd4320b65a94345a8f087f3dce2346b8f55e64c;p=php Allocating hash tables should be done via macro, not directly --- diff --git a/main/streams/filter.c b/main/streams/filter.c index cc6e62292f..da61c714fa 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -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)); } diff --git a/main/streams/streams.c b/main/streams/streams.c index dfe54fc550..bb2b137c32 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -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)); }