Skip to content

Commit e932088

Browse files
mheijkoopSean-Der
authored andcommitted
do not make references indirect in var_replace
workaround for #94, possibly at the expense of leaking a bit of memory?
1 parent 5c9870c commit e932088

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack_unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static zval *msgpack_var_push(msgpack_unserialize_data_t *var_hashx) /* {{{ */ {
9292
/* }}} */
9393

9494
static inline void msgpack_var_replace(zval *old, zval *new) /* {{{ */ {
95-
if (!MSGPACK_IS_STACK_VALUE(old)) {
95+
if (!MSGPACK_IS_STACK_VALUE(old) && Z_TYPE_P(old) != IS_REFERENCE) {
9696
ZVAL_INDIRECT(old, new);
9797
}
9898
}

0 commit comments

Comments
 (0)