From: Michal Rakowski Date: Thu, 20 May 2021 14:09:19 +0000 (+0200) Subject: Fix #7669 About 'cancel inactive' crashing director X-Git-Tag: Release-11.3.2~531 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e994eb504a20ff433fbcb3109f4a2a2c2f70d652;p=thirdparty%2Fbacula.git Fix #7669 About 'cancel inactive' crashing director --- diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index 2e19bc6b5..fe8e4b923 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -1159,10 +1159,12 @@ bool get_storage_resource(UAContext *ua, USTORE *ustore, bool use_default, bool ua->error_msg(_("JobId %s is not running.\n"), edit_int64(jobid, ed1)); goto bail_out; } - STORE *wstore = jcr->store_mngr->get_wstore(); - if (wstore) { - bstrncpy(store_name, wstore->name(), sizeof(store_name)); - pm_strcpy(ustore->store_source, _("Command line (jobid parameter)")); + if (jcr->store_mngr) { + STORE *wstore = jcr->store_mngr->get_wstore(); + if (wstore) { + bstrncpy(store_name, wstore->name(), sizeof(store_name)); + pm_strcpy(ustore->store_source, _("Command line (jobid parameter)")); + } } free_jcr(jcr); @@ -1176,10 +1178,12 @@ bool get_storage_resource(UAContext *ua, USTORE *ustore, bool use_default, bool ua->error_msg(_("Job \"%s\" is not running.\n"), ua->argv[i]); goto bail_out; } - STORE *wstore = jcr->store_mngr->get_wstore(); - if (wstore) { - bstrncpy(store_name, wstore->name(), sizeof(store_name)); - pm_strcpy(ustore->store_source, _("Command line (job/jobname parameter)")); + if (jcr->store_mngr) { + STORE *wstore = jcr->store_mngr->get_wstore(); + if (wstore) { + bstrncpy(store_name, wstore->name(), sizeof(store_name)); + pm_strcpy(ustore->store_source, _("Command line (job/jobname parameter)")); + } } free_jcr(jcr); @@ -1189,10 +1193,12 @@ bool get_storage_resource(UAContext *ua, USTORE *ustore, bool use_default, bool goto bail_out; } if ((jcr=get_jcr_by_full_name(ua->argv[i]))) { - STORE *wstore = jcr->store_mngr->get_wstore(); - if (wstore) { - bstrncpy(store_name, wstore->name(), sizeof(store_name)); - pm_strcpy(ustore->store_source, _("Command line (ujobid parameter)")); + if (jcr->store_mngr) { + STORE *wstore = jcr->store_mngr->get_wstore(); + if (wstore) { + bstrncpy(store_name, wstore->name(), sizeof(store_name)); + pm_strcpy(ustore->store_source, _("Command line (ujobid parameter)")); + } } free_jcr(jcr); }