Skip to content

Commit 5fc71c7

Browse files
committed
Correctly destroy reference in ArrayObject sort
The reference may be captured in an exception backtrace, in which case the refcount may be more than one.
1 parent cb3cfc9 commit 5fc71c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/spl/spl_array.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,8 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
14701470
} else {
14711471
GC_DELREF(aht);
14721472
}
1473-
efree(Z_REF(params[0]));
1473+
ZVAL_NULL(Z_REFVAL(params[0]));
1474+
zval_ptr_dtor(&params[0]);
14741475
zend_string_free(Z_STR(function_name));
14751476
}
14761477
} /* }}} */

0 commit comments

Comments
 (0)