summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/debug.c b/src/debug.c
index dd96ad416..36af35aec 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -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;
}