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

This commit is contained in:
antirez 2011-12-19 10:16:37 +01:00
parent a244a13b4c
commit 0a466a7542

View 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;