Merge pull request #6783 from hwware/memoryleakfix

Fix Memory Leaks in debug.c
This commit is contained in:
Salvatore Sanfilippo
2020-02-27 10:12:07 +01:00
committed by GitHub

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