Browse Source

Allocating hash tables should be done via macro, not directly

PHP-5.1
Sara Golemon 22 years ago
parent
commit
9cd4320b65
  1. 2
      main/streams/filter.c
  2. 4
      main/streams/streams.c

2
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));
}

4
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));
}

Loading…
Cancel
Save