diff options
author | hwware <wen.hui.ware@gmail.com> | 2020-01-16 17:33:23 -0500 |
---|---|---|
committer | hwware <wen.hui.ware@gmail.com> | 2020-01-16 17:33:23 -0500 |
commit | 3f6d00d387b85b0eaa459427c2891ca979dc8363 (patch) | |
tree | 80a1716e80d09e604000aca82ef7be24731ddda5 | |
parent | 7ef2270ee73e75b00b0c1bde40fb1df55c7ec6ff (diff) | |
download | redis-3f6d00d387b85b0eaa459427c2891ca979dc8363.tar.gz |
fix potentical memory leaks
-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 a2d37337d..b441fa8f8 100644 --- a/src/debug.c +++ b/src/debug.c @@ -683,9 +683,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; } |