From: Kern Sibbald Date: Fri, 3 Feb 2012 10:30:38 +0000 (+0100) Subject: Fix lost dcr point -- memory loss in Copy/Migration + possible confusion X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f7b8830ae680d62dbd9fb82fc1244c7723c13d60;p=bacula%2Fbacula Fix lost dcr point -- memory loss in Copy/Migration + possible confusion --- diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 50344de8b0..8818f43278 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -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);