]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/job.c
kes Make sure valid argument passed to str_to_utime() where Arno
[bacula/bacula] / bacula / src / stored / job.c
index b9fa039c6fc3a63f3157f6fbb31262f00019b7de..28629c3b51e32b776d1149b206e4c1c112d81244 100644 (file)
@@ -305,6 +305,7 @@ bool query_cmd(JCR *jcr)
  */
 void stored_free_jcr(JCR *jcr)
 {
+   Dmsg1(900, "stored_free_jcr JobId=%u\n", jcr->JobId);
    if (jcr->file_bsock) {
       bnet_close(jcr->file_bsock);
       jcr->file_bsock = NULL;
@@ -347,14 +348,25 @@ void stored_free_jcr(JCR *jcr)
       free_dcr(jcr->read_dcr);
       jcr->read_dcr = NULL;
    }
-   if (jcr->dirstore) {
+
+   if (jcr->read_store) {
       DIRSTORE *store;
-      foreach_alist(store, jcr->dirstore) {
+      foreach_alist(store, jcr->read_store) {
          delete store->device;
          delete store;
       }
-      delete jcr->dirstore;
-      jcr->dirstore = NULL;
+      delete jcr->read_store;
+      jcr->read_store = NULL;
    }
+   if (jcr->write_store) {
+      DIRSTORE *store;
+      foreach_alist(store, jcr->write_store) {
+         delete store->device;
+         delete store;
+      }
+      delete jcr->write_store;
+      jcr->write_store = NULL;
+   }
+
    return;
 }