]> git.saurik.com Git - redis.git/commitdiff
Fixed memleak in CLIENT INFO, added simple test that will work as regression test...
authorantirez <antirez@gmail.com>
Mon, 19 Dec 2011 09:16:37 +0000 (10:16 +0100)
committerantirez <antirez@gmail.com>
Mon, 19 Dec 2011 09:16:37 +0000 (10:16 +0100)
src/networking.c

index f1c6627ce7e356311539397a83b8394b9a35b9e8..bc807c4b905a041d6fa7f294374b7fdb0267a5d2 100644 (file)
@@ -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;