From c466e56e91544bc44ee32fc644f106eac02fadb1 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Dec 2011 10:16:37 +0100 Subject: [PATCH] Fixed memleak in CLIENT INFO, added simple test that will work as regression test on mac os x and in the CI when running over valgrind. This fixes issue #256 --- src/networking.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index f1c6627ce..bc807c4b9 100644 --- a/src/networking.c +++ b/src/networking.c @@ -997,8 +997,12 @@ sds getAllClientsInfoString(void) { listRewind(server.clients,&li); while ((ln = listNext(&li)) != NULL) { + sds cs; + client = listNodeValue(ln); - o = sdscatsds(o,getClientInfoString(client)); + cs = getClientInfoString(client); + o = sdscatsds(o,cs); + sdsfree(cs); o = sdscatlen(o,"\n",1); } return o;