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>2015-01-30 02:57:17 +0300
committermichael-grunder <michael.grunder@gmail.com>2015-05-06 01:13:39 +0300
commit9c4de060e6be42d39e35c70de0cd37456f5587db (patch)
tree07ac228968282b185c564750113f155367b4b987 /redis_array_impl.c
parent887eff0a9ad0f35a982ecacfdfc93e11b3a7e079 (diff)
Fix rehashing memory leaks
The pattern to move a key for various types (strings, sets, zsets, hashes, etc) used a simple pattern: 1. Construct the call in order to get all of the keys from the source 2. Make a pass through call to the source node to get a response 3. Use the response to make a pass through call to the destination node The issue, however, was that we were using the same return value variable for both source and destination nodes, so we would leak the response from the source node. Conflicts: redis_array_impl.c
Diffstat (limited to 'redis_array_impl.c')
-rw-r--r--redis_array_impl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/redis_array_impl.c b/redis_array_impl.c
index d22ae620..98dec588 100644
--- a/redis_array_impl.c
+++ b/redis_array_impl.c
@@ -957,7 +957,9 @@ ra_move_zset(const char *key, int key_len, zval *z_from, zval *z_to, long ttl TS
for(i = 0; i < 1 + 2 * count; ++i) {
efree(z_zadd_args[i]);
}
-
+
+ zval_dtor(&z_ret);
+
/* Free the array itself */
efree(z_zadd_args);