]> git.saurik.com Git - redis.git/commitdiff
fixed a minor memory leak in configuration file parsing
authorantirez <antirez@gmail.com>
Fri, 15 Jan 2010 18:35:13 +0000 (13:35 -0500)
committerantirez <antirez@gmail.com>
Fri, 15 Jan 2010 18:35:13 +0000 (13:35 -0500)
redis.c
test-redis.tcl

diff --git a/redis.c b/redis.c
index 343dce1554f703b6f9b9da22f860651832b54474..417cd200baeff8ccc8244a18541b21f1895b9b08 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -1633,6 +1633,7 @@ static void loadServerConfig(char *filename) {
                 err = "argument must be 'yes' or 'no'"; goto loaderr;
             }
         } else if (!strcasecmp(argv[0],"vm-swap-file") && argc == 2) {
+            zfree(server.vm_swap_file);
             server.vm_swap_file = zstrdup(argv[1]);
         } else if (!strcasecmp(argv[0],"vm-max-memory") && argc == 2) {
             server.vm_max_memory = strtoll(argv[1], NULL, 10);
index 0b230e58cc23d2327c2c8ead0a516dc4f65b276d..c0a025af2aecde808a002a6d54f8b4eeb33a3801 100644 (file)
@@ -317,9 +317,9 @@ proc main {server port} {
         set _ $err
     } {}
 
-    test {DBSIZE should be 10001 now} {
+    test {DBSIZE should be 10101 now} {
         $r dbsize
-    } {10001}
+    } {10101}
 
     test {INCR against non existing key} {
         set res {}