From 1b15d1f166cc2b15c88af0a78147bdd556d7529c Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 7 Jan 2001 10:42:15 +0000 Subject: [PATCH] Use MAKE_STD_ZVAL/FREE_ZVAL to handle zval memory allocation. --- ext/session/session.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/session/session.c b/ext/session/session.c index f0bdbdd75c..ade3f81297 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -306,7 +306,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) PHP_VAR_UNSERIALIZE_INIT(var_hash); - current = (zval *) ecalloc(sizeof(zval), 1); + MAKE_STD_ZVAL(current); for (p = val; p < endptr; ) { namelen = *p & (~PS_BIN_UNDEF); has_value = *p & PS_BIN_UNDEF ? 0 : 1; @@ -324,7 +324,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) PS_ADD_VARL(name, namelen); efree(name); } - efree(current); + FREE_ZVAL(current); PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return SUCCESS; @@ -386,7 +386,7 @@ PS_SERIALIZER_DECODE_FUNC(php) PHP_VAR_UNSERIALIZE_INIT(var_hash); - current = (zval *) ecalloc(sizeof(zval), 1); + MAKE_STD_ZVAL(current); for (p = q = val; (p < endptr) && (q = memchr(p, PS_DELIMITER, endptr - p)); p = q) { if (p[0] == PS_UNDEF_MARKER) { p++; @@ -408,7 +408,7 @@ PS_SERIALIZER_DECODE_FUNC(php) PS_ADD_VARL(name, namelen); efree(name); } - efree(current); + FREE_ZVAL(current); PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return SUCCESS; -- 2.40.0