Skip to content

Commit c8e7241

Browse files
committed
- Need to operate on module pointer in hash table
1 parent 8d9ced8 commit c8e7241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Zend/zend_API.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC)
11621162
{
11631163
int name_len;
11641164
char *lcname;
1165+
zend_module_entry *module_ptr;
11651166

11661167
if (!module) {
11671168
return FAILURE;
@@ -1173,12 +1174,13 @@ ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC)
11731174
name_len = strlen(module->name);
11741175
lcname = zend_str_tolower_dup(module->name, name_len);
11751176

1176-
if (zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), NULL)==FAILURE) {
1177+
if (zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), (void**)&module_ptr)==FAILURE) {
11771178
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
11781179
efree(lcname);
11791180
return FAILURE;
11801181
}
11811182
efree(lcname);
1183+
module = module_ptr;
11821184

11831185
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
11841186
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);

0 commit comments

Comments
 (0)