From 636e5f344afb4b770dfb935325b014c757e9ba13 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 3 Feb 2012 11:30:38 +0100 Subject: [PATCH] Fix lost dcr point -- memory loss in Copy/Migration + possible confusion --- bacula/src/stored/reserve.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.39.5