Fix a use after free error, of the conf pointer
authorChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 30 Sep 2016 16:43:36 +0000 (18:43 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 30 Sep 2016 16:43:36 +0000 (18:43 +0200)
Caused a segfault in the reconfigure sig hangler codepath.

unmid.c

diff --git a/unmid.c b/unmid.c
index 51b3638..6c99ace 100644 (file)
--- a/unmid.c
+++ b/unmid.c
@@ -223,6 +223,8 @@ static int
 reconfigure (void)
 {
        free(conf);
+       conf = NULL;
+       condlog(LOG_DEBUG, "old config freed");
        load_config();
        daemon_state = DAEMON_RUNNING;
        return 0;