From abe148ea1e4e8ea6d7dd001ef61ec5daf6f34fba Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 30 Oct 2013 20:09:51 +0200 Subject: [PATCH] Fix #1485 --- ext/cache/backend/memcache.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/cache/backend/memcache.c b/ext/cache/backend/memcache.c index 421c03421bf..cd631ff07c9 100644 --- a/ext/cache/backend/memcache.c +++ b/ext/cache/backend/memcache.c @@ -586,7 +586,7 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, decrement){ PHP_METHOD(Phalcon_Cache_Backend_Memcache, flush){ zval *memcache, *options, *special_key; - zval *keys, *real_key = NULL; + zval *keys; HashPosition pos; zval **value; @@ -618,13 +618,10 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, flush){ ) { zval key = phalcon_get_current_key_w(Z_ARRVAL_P(keys), &pos); - PHALCON_INIT_NVAR(real_key); - ZVAL_STRINGL(real_key, Z_STRVAL(key), Z_STRLEN(key), 1); - - phalcon_array_unset(&keys, real_key, 0); - phalcon_call_method_p1_noret(memcache, "delete", real_key); + phalcon_call_method_p1_noret(memcache, "delete", &key); } + zend_hash_clean(Z_ARRVAL_P(keys)); phalcon_call_method_p2_noret(memcache, "set", special_key, keys); }