Module: kamailio
Branch: master
Commit: 26b072c7c84c03d034cd31cd80ef2d78ecb76dce
URL:
https://github.com/kamailio/kamailio/commit/26b072c7c84c03d034cd31cd80ef2d7…
Author: Claudiu Boriga <paul.boriga(a)1and1.ro>
Committer: Claudiu Boriga <paul.boriga(a)1and1.ro>
Date: 2017-05-02T17:55:01+03:00
ndb_redis: fix memory leak
- fix memory leak when re-using a reply-id
---
Modified: src/modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/26b072c7c84c03d034cd31cd80ef2d7…
Patch:
https://github.com/kamailio/kamailio/commit/26b072c7c84c03d034cd31cd80ef2d7…
---
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 4998e65..4ebdeb1 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -599,6 +599,12 @@ int redisc_exec_pipelined(redisc_server_t *rsrv)
for (i=1;i<rsrv->piped.pending_commands;i++)
{
rpl=rsrv->piped.replies[i];
+ if(rpl->rplRedis!=NULL)
+ {
+ /* clean up previous redis reply */
+ freeReplyObject(rpl->rplRedis);
+ rpl->rplRedis = NULL;
+ }
if (redisGetReplyFromReader(rsrv->ctxRedis, (void**) &rpl->rplRedis) !=
REDIS_OK)
{
LM_ERR("Unable to read reply\n");