summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDov Murik <dov.murik@trusteer.com>2012-12-26 22:00:08 +0200
committerantirez <antirez@gmail.com>2014-08-18 11:05:36 +0200
commit233d24a7378f3ef59baa7aa593278338c8e9d0d9 (patch)
tree1d333ebc7a14733e87ca03d934639665041532f9 /src
parentd786fb6e94fab0204a05caa0966fc2a37d9168ee (diff)
downloadredis-233d24a7378f3ef59baa7aa593278338c8e9d0d9.tar.gz
redis-cli: fix prompt after shutdown command
Fix redis-cli prompt to state "not connected" after a SHUTDOWN command is sent.
Diffstat (limited to 'src')
-rw-r--r--src/redis-cli.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 2e13d3060..3526319d5 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -517,8 +517,11 @@ static int cliReadReply(int output_raw_strings) {
int output = 1;
if (redisGetReply(context,&_reply) != REDIS_OK) {
- if (config.shutdown)
+ if (config.shutdown) {
+ redisFree(context);
+ context = NULL;
return REDIS_OK;
+ }
if (config.interactive) {
/* Filter cases where we should reconnect */
if (context->err == REDIS_ERR_IO && errno == ECONNRESET)