Minor memory leak in redis-cli (issue #464)
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Sun, 6 Mar 2011 19:13:01 +0000 (20:13 +0100)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Sun, 6 Mar 2011 19:13:01 +0000 (20:13 +0100)
src/redis-cli.c

index 563c75300798e3af6879c7983b7c09215cf319bb..e19a555f4ba2415252b4ca0ee3f6fee0fdcf2329 100644 (file)
@@ -488,9 +488,13 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
             }
         }
 
-        if (cliReadReply(output_raw) != REDIS_OK)
+        if (cliReadReply(output_raw) != REDIS_OK) {
+            free(argvlen);
             return REDIS_ERR;
+        }
     }
+
+    free(argvlen);
     return REDIS_OK;
 }