summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-09-11 16:31:11 +0000
committerXuefer <xuefer@gmail.com>2014-09-11 16:31:11 +0000
commit293e6ab44a1a2f4fab913d5ae4603e64adb2e243 (patch)
tree0f9e1861209292a77b9ef490066d1fe14005944b
parent21a895a4c68b59a89f7855d3996ba4698cafe21c (diff)
downloadxcache-293e6ab44a1a2f4fab913d5ae4603e64adb2e243.tar.gz
xcache-293e6ab44a1a2f4fab913d5ae4603e64adb2e243.zip
refix fix leak in decompiler/disassembler, was broken for older PHP
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1523 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rw-r--r--xcache.c15
-rw-r--r--xcache/xc_compatibility.h7
2 files changed, 9 insertions, 13 deletions
diff --git a/xcache.c b/xcache.c
index 36c3f44..d265fd9 100644
--- a/xcache.c
+++ b/xcache.c
@@ -354,21 +354,24 @@ static unsigned char arginfo_xcache_get_special_value[] = { 1, BYREF_NONE };
PHP_FUNCTION(xcache_get_special_value)
{
zval *value;
+ zval value_copied;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
return;
}
+ value_copied = *value;
+ value = &value_copied;
switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) {
case IS_CONSTANT:
- MAKE_COPY_ZVAL(&value, return_value)
- return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
+ value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
+ RETURN_ZVAL(value, 1, 0);
break;
#ifdef IS_CONSTANT_ARRAY
case IS_CONSTANT_ARRAY:
- MAKE_COPY_ZVAL(&value, return_value)
- return_value->type = IS_ARRAY;
+ value->type = IS_ARRAY;
+ RETURN_ZVAL(value, 1, 0);
break;
#endif
@@ -380,8 +383,8 @@ PHP_FUNCTION(xcache_get_special_value)
default:
if ((Z_TYPE_P(value) & ~IS_CONSTANT_TYPE_MASK)) {
- MAKE_COPY_ZVAL(&value, return_value);
- return_value->type &= IS_CONSTANT_TYPE_MASK;
+ value->type &= IS_CONSTANT_TYPE_MASK;
+ RETURN_ZVAL(value, 1, 0);
}
else {
RETURN_NULL();
diff --git a/xcache/xc_compatibility.h b/xcache/xc_compatibility.h
index 1d01656..9fad4db 100644
--- a/xcache/xc_compatibility.h
+++ b/xcache/xc_compatibility.h
@@ -219,13 +219,6 @@ 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;