]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/job.c
Move reservations message lock to lock jcr only this
[bacula/bacula] / bacula / src / stored / job.c
index fe0389654fe0f3caeb32cf6bcfbfcd72837d5884..8215000b83d5eb756a89e38062457dd4249e665d 100644 (file)
@@ -7,8 +7,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -356,6 +356,10 @@ void stored_free_jcr(JCR *jcr)
    }
    jcr->dcrs = NULL;
 
+   /* Avoid a double free */
+   if (jcr->dcr == jcr->read_dcr) {
+      jcr->read_dcr = NULL;
+   }
    if (jcr->dcr) {
       free_dcr(jcr->dcr);
       jcr->dcr = NULL;