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
commit f7e05dc755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

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