From: Sascha Schumann Date: Sun, 7 Jan 2001 10:42:15 +0000 (+0000) Subject: Use MAKE_STD_ZVAL/FREE_ZVAL to handle zval memory allocation. X-Git-Tag: php-4.0.5RC1~701 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b15d1f166cc2b15c88af0a78147bdd556d7529c;p=php Use MAKE_STD_ZVAL/FREE_ZVAL to handle zval memory allocation. --- 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;