Commit 3f6d00d3 authored by hwware's avatar hwware
Browse files

fix potentical memory leaks

parent 7ef2270e
...@@ -683,9 +683,12 @@ NULL ...@@ -683,9 +683,12 @@ NULL
sds stats = sdsempty(); sds stats = sdsempty();
char buf[4096]; char buf[4096];
if (getLongFromObjectOrReply(c, c->argv[2], &dbid, NULL) != C_OK) if (getLongFromObjectOrReply(c, c->argv[2], &dbid, NULL) != C_OK){
sdsfree(stats);
return; return;
}
if (dbid < 0 || dbid >= server.dbnum) { if (dbid < 0 || dbid >= server.dbnum) {
sdsfree(stats);
addReplyError(c,"Out of range database"); addReplyError(c,"Out of range database");
return; return;
} }
......
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