]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix possible seg fault if debug mode set
authorKern Sibbald <kern@sibbald.com>
Sun, 20 Dec 2015 11:25:58 +0000 (12:25 +0100)
committerKern Sibbald <kern@sibbald.com>
Sun, 20 Dec 2015 11:38:35 +0000 (12:38 +0100)
bacula/src/stored/reserve.c

index cad831abdda477a685fda6b1a25f00514d635294..c5b3af436cbb362a6fc03dac214563420e427012 100644 (file)
@@ -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;
    }