From e8a8f9df7c3ec9366b9c22129006788fb7e6b2af Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 2 Oct 2016 09:55:45 +0200 Subject: [PATCH] Make another attempt to resolve bug #2176 --- bacula/src/dird/dird_conf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 0dec091aba..5cad2b9d6b 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -2163,6 +2163,11 @@ extern "C" char *job_code_callback_director(JCR *jcr, const char* param) { static char yes[] = "yes"; static char no[] = "no"; + static char nothing[] = ""; + + if (jcr == NULL) { + return nothing; + } switch (param[0]) { case 'f': if (jcr->fileset) { @@ -2191,7 +2196,7 @@ extern "C" char *job_code_callback_director(JCR *jcr, const char* param) case 'C': return jcr->cloned ? yes : no; } - return NULL; + return nothing; } bool parse_dir_config(CONFIG *config, const char *configfile, int exit_code) -- 2.39.5