Browse Source

decompiler: fix leak

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1493 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 7 years ago
parent
commit
caf19fe783
  1. 9
      xcache.c
  2. 7
      xcache/xc_compatibility.h

9
xcache.c

@ -361,15 +361,13 @@ PHP_FUNCTION(xcache_get_special_value)
switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) {
case IS_CONSTANT:
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value)
return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
break;
#ifdef IS_CONSTANT_ARRAY
case IS_CONSTANT_ARRAY:
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value)
return_value->type = IS_ARRAY;
break;
#endif
@ -382,8 +380,7 @@ PHP_FUNCTION(xcache_get_special_value)
default:
if ((Z_TYPE_P(value) & ~IS_CONSTANT_TYPE_MASK)) {
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value);
return_value->type &= IS_CONSTANT_TYPE_MASK;
}
else {

7
xcache/xc_compatibility.h

@ -219,6 +219,13 @@ typedef const zstr const_zstr;
#endif
/* }}} */
#ifndef MAKE_COPY_ZVAL
# define MAKE_COPY_ZVAL(ppzv, pzv) \
*(pzv) = **(ppzv); \
zval_copy_ctor((pzv)); \
INIT_PZVAL((pzv));
#endif
/* the class entry type to be stored in class_table */
typedef ZESW(zend_class_entry, zend_class_entry*) xc_cest_t;

Loading…
Cancel
Save