]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix bug #2534 possible double free in error case
authorKern Sibbald <kern@sibbald.com>
Fri, 1 May 2020 14:50:35 +0000 (16:50 +0200)
committerKern Sibbald <kern@sibbald.com>
Fri, 1 May 2020 14:50:35 +0000 (16:50 +0200)
bacula/src/filed/restore.c

index 7f4c212d6cc06ac16901c405695bfb10f52592e0..9ed0ff2d295134c95fa060acc44e282f5c662c45 100644 (file)
@@ -1766,6 +1766,7 @@ static bool verify_signature(r_ctx &rctx)
                Jmsg(jcr, M_ERROR, 0, _("Digest one file failed for file: %s\n"),
                     jcr->last_fname);
                jcr->JobBytes = saved_bytes;
+               jcr->crypto.digest = NULL;
                goto get_out;
             }
             jcr->JobBytes = saved_bytes;
@@ -1775,6 +1776,7 @@ static bool verify_signature(r_ctx &rctx)
                Dmsg1(50, "Bad signature on %s\n", jcr->last_fname);
                Jmsg2(jcr, M_ERROR, 0, _("Signature validation failed for file %s: ERR=%s\n"),
                      jcr->last_fname, crypto_strerror(err));
+               jcr->crypto.digest = NULL;
                goto get_out;
             }
             jcr->crypto.digest = NULL;