]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix lost dcr point -- memory loss in Copy/Migration + possible confusion
authorKern Sibbald <kern@sibbald.com>
Fri, 3 Feb 2012 10:30:38 +0000 (11:30 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:18 +0000 (14:50 +0200)
bacula/src/stored/reserve.c

index 50344de8b0ebfd88d16f33e673a1a2652a3890af..8818f43278fadd76cf4f0bc20ead42e110a0fa98 100644 (file)
@@ -236,6 +236,7 @@ static bool use_storage_cmd(JCR *jcr)
       }
    }  while (ok && dir->recv() >= 0);
 
+#ifdef xxxx
    /* Developer debug code */
    char *device_name;
    if (debug_level >= dbglvl) {
@@ -248,6 +249,7 @@ static bool use_storage_cmd(JCR *jcr)
          }
       }
    }
+#endif
 
    init_jcr_device_wait_timers(jcr);
    jcr->dcr = new_dcr(jcr, NULL, NULL);         /* get a dcr */
@@ -272,6 +274,12 @@ static bool use_storage_cmd(JCR *jcr)
       bool fail = false;
       rctx.notify_dir = true;
 
+      /* Put new dcr in proper location */
+      if (rctx.append) {
+         rctx.jcr->dcr = jcr->dcr;
+      } else {
+         rctx.jcr->read_dcr = jcr->dcr;
+      }
       lock_reservations();
       for ( ; !fail && !job_canceled(jcr); ) {
          pop_reserve_messages(jcr);