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
parent2d39b48d4ac343bde1e42de7568e032ed3db4227 (diff)
Fix a couple of memory leaks in Redis/RedisCluster
Addresses #1701
-rw-r--r--cluster_library.c2
-rw-r--r--redis_commands.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/cluster_library.c b/cluster_library.c
index bce78bc9..24d3110a 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -2448,6 +2448,8 @@ PHP_REDIS_API void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
} else {
add_next_index_zval(&c->multi_resp, mctx->z_multi);
}
+
+ efree(mctx->z_multi);
}
// Clean up this context item
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: */