Commit 8b860b36 authored by antirez's avatar antirez
Browse files

Fixed memleak in CLIENT INFO, added simple test that will work as regression...

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
parent 61e44f61
...@@ -956,8 +956,12 @@ sds getAllClientsInfoString(void) { ...@@ -956,8 +956,12 @@ sds getAllClientsInfoString(void) {
listRewind(server.clients,&li); listRewind(server.clients,&li);
while ((ln = listNext(&li)) != NULL) { while ((ln = listNext(&li)) != NULL) {
sds cs;
client = listNodeValue(ln); client = listNodeValue(ln);
o = sdscatsds(o,getClientInfoString(client)); cs = getClientInfoString(client);
o = sdscatsds(o,cs);
sdsfree(cs);
o = sdscatlen(o,"\n",1); o = sdscatlen(o,"\n",1);
} }
return o; return o;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment