From: Kern Sibbald Date: Fri, 1 May 2020 14:50:35 +0000 (+0200) Subject: Fix bug #2534 possible double free in error case X-Git-Tag: Release-9.6.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17c864a51f8ee52eaa4e3a8aa6844c9e12424104;p=thirdparty%2Fbacula.git Fix bug #2534 possible double free in error case --- diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 7f4c212d6..9ed0ff2d2 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -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;