Skip to content

Commit

Permalink
fixed a minor memory leak in configuration file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 15, 2010
1 parent 2316bb3 commit fefed59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test-redis.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit fefed59

Please sign in to comment.