Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2020-01-18 00:29:07 +0300
committerMichael Grunder <michael.grunder@gmail.com>2020-01-19 20:35:24 +0300
commita107c9fc08e05c7961750be9dfaec661ca1cbefb (patch)
treee87cff0536fa3f7527ae6488b87dfe055197da83 /redis_commands.c
parent2d39b48d4ac343bde1e42de7568e032ed3db4227 (diff)
Fix a couple of memory leaks in Redis/RedisCluster
Addresses #1701
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 97fa0e13..b98d0d27 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -4083,13 +4083,14 @@ void redis_unserialize_handler(INTERNAL_FUNCTION_PARAMETERS,
// Just return the value that was passed to us
RETURN_STRINGL(value, value_len);
}
- zval zv, *z_ret = &zv;
- if (!redis_unserialize(redis_sock, value, value_len, z_ret)) {
+
+ zval z_ret;
+ if (!redis_unserialize(redis_sock, value, value_len, &z_ret)) {
// Badly formed input, throw an exception
zend_throw_exception(ex, "Invalid serialized data, or unserialization error", 0);
RETURN_FALSE;
}
- RETURN_ZVAL(z_ret, 1, 0);
+ RETURN_ZVAL(&z_ret, 0, 0);
}
/* vim: set tabstop=4 softtabstop=4 expandtab shiftwidth=4: */