From 52c562f9a0d02a580e68c8cac51cc67fc7d045c6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 20 Dec 2015 12:25:58 +0100 Subject: [PATCH] Fix possible seg fault if debug mode set --- bacula/src/stored/reserve.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.39.5