From: Kern Sibbald Date: Sun, 20 Dec 2015 11:25:58 +0000 (+0100) Subject: Fix possible seg fault if debug mode set X-Git-Tag: Release-7.4.0~98 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=52c562f9a0d02a580e68c8cac51cc67fc7d045c6;p=bacula%2Fbacula Fix possible seg fault if debug mode set --- diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index cad831abdd..c5b3af436c 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -608,8 +608,12 @@ static bool is_vol_in_autochanger(RCTX &rctx, VOLRES *vol) { AUTOCHANGER *changer = vol->dev->device->changer_res; + if (!changer) { + return false; + } + /* Find resource, and make sure we were able to open it */ - if (changer && strcmp(rctx.device_name, changer->hdr.name) == 0) { + if (strcmp(rctx.device_name, changer->hdr.name) == 0) { Dmsg1(dbglvl, "Found changer device %s\n", vol->dev->device->hdr.name); return true; }