Skip to content

Commit 46cb06f

Browse files
committed
...
1 parent 3b90436 commit 46cb06f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/appserver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ PHP_FUNCTION(appserver_redefine)
258258
if ((defined->module_number == PHP_USER_CONSTANT)) {
259259
zend_constant container = *defined;
260260

261-
container.name = zend_strndup(container.name, container.name_len);
261+
if (pzval)
262+
container.name = zend_strndup(container.name, container.name_len);
262263

263264
if (zend_hash_del(EG(zend_constants), name, name_len+1)==SUCCESS) {
264265
if (pzval) {
@@ -267,9 +268,8 @@ PHP_FUNCTION(appserver_redefine)
267268
zend_hash_next_index_insert(
268269
&APPSERVER_GLOBALS(redefined), &pzval, sizeof(zval**), NULL);
269270
Z_ADDREF_P(pzval);
270-
zend_register_constant(
271-
&container TSRMLS_CC);
272-
}
271+
zend_register_constant(&container TSRMLS_CC);
272+
}
273273
}
274274
} else {
275275
/* change internal constant */

0 commit comments

Comments
 (0)