diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2020-02-27 10:12:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 10:12:07 +0100 |
commit | f7e05dc7550c4002e4217a4da5922d9d5a27a3b6 (patch) | |
tree | f7dfb9dfc24fb7671323ce0a6688baefb3433f86 | |
parent | 4f29753726e7e6361e02360f4650fa93a9a0a6bf (diff) | |
parent | 67ee87522ab5b3c3bae8ee4c84808664b14de2cc (diff) | |
download | redis-f7e05dc7550c4002e4217a4da5922d9d5a27a3b6.tar.gz |
Merge pull request #6783 from hwware/memoryleakfix
Fix Memory Leaks in debug.c
-rw-r--r-- | src/debug.c | 5 |
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; } |