fix potentical memory leaks

This commit is contained in:
hwware 2020-01-16 17:33:23 -05:00 committed by antirez
parent 973297336f
commit 1bb5ee9c68

View File

@ -685,9 +685,12 @@ NULL
sds stats = sdsempty();
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;
}
if (dbid < 0 || dbid >= server.dbnum) {
sdsfree(stats);
addReplyError(c,"Out of range database");
return;
}