From 0a466a754226d5b13cd555a2893867084ee981d4 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 f1c6627c..bc807c4b 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; -- 2.47.2