Fix memory leak on reconfiguration
authorSteven Luo <steven+maemo@steven676.net>
Sun, 30 May 2010 07:48:37 +0000 (00:48 -0700)
committerSteven Luo <steven+maemo@steven676.net>
Sun, 30 May 2010 07:48:37 +0000 (00:48 -0700)
Caught by valgrind.

main.c

diff --git a/main.c b/main.c
index 30361c8..40823e3 100644 (file)
--- a/main.c
+++ b/main.c
@@ -50,6 +50,7 @@ static void read_config(int signalnum) {
 
        log_config(cfg.logging);
        ctx.continuous_mode = cfg.continuous_mode;
 
        log_config(cfg.logging);
        ctx.continuous_mode = cfg.continuous_mode;
+       free(ctx.other_browser_cmd);
        if (cfg.other_browser_cmd) {
                if (!(ctx.other_browser_cmd = strdup(cfg.other_browser_cmd))) {
                        log_perror(errno, "Failed to set other_browser_cmd");
        if (cfg.other_browser_cmd) {
                if (!(ctx.other_browser_cmd = strdup(cfg.other_browser_cmd))) {
                        log_perror(errno, "Failed to set other_browser_cmd");