From 149cf2bb5bc4c54ccb987ee687ca8243bd151135 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Tue, 4 Mar 2014 22:02:46 +0200 Subject: [PATCH] Fix online reconfiguration: Test rundir usability in the correct place. It was tested in reconfiguration, using a null pointer. --- src/config.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 9d45b6c..7f28098 100644 --- a/src/config.c +++ b/src/config.c @@ -1243,6 +1243,7 @@ int read_config(void) * for the first time. */ if (!rundir) { + /* initial setup */ if (new_rundir) { rundir = new_rundir; new_rundir = NULL; @@ -1250,16 +1251,17 @@ int read_config(void) hlog(LOG_CRIT, "Config: rundir not defined."); failed = 1; } + + if (test_directory(rundir)) { + hlog(LOG_CRIT, "Config: rundir %s is not a directory.", rundir); + failed = 1; + } } else { + /* reconfig */ if (new_rundir) { hfree(new_rundir); new_rundir = NULL; } - - if (test_directory(new_rundir)) { - hlog(LOG_CRIT, "Config: rundir %s is not a directory.", new_rundir); - failed = 1; - } } if (!log_dir) {