From: Erik Hovland Date: Wed, 18 Mar 2009 13:48:07 +0000 (+0100) Subject: S/MIME: Don't leak intermediate cert key X-Git-Tag: neomutt-20160307~748 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e7408a34618ac2e8d86557d2d6692d214cf1463;p=neomutt S/MIME: Don't leak intermediate cert key --- diff --git a/smime.c b/smime.c index 95facec12..997ff757e 100644 --- a/smime.c +++ b/smime.c @@ -1387,6 +1387,7 @@ BODY *smime_sign_message (BODY *a ) if (!SmimeDefaultKey) { mutt_error _("Can't sign: No key specified. Use Sign As."); + FREE (&intermediates); return NULL; } @@ -1402,6 +1403,8 @@ BODY *smime_sign_message (BODY *a ) if ((sfp = safe_fopen (filetosign, "w+")) == NULL) { mutt_perror (filetosign); + if (intermediates != SmimeDefaultKey) + FREE (&intermediates); return NULL; } @@ -1411,6 +1414,8 @@ BODY *smime_sign_message (BODY *a ) mutt_perror (signedfile); safe_fclose (&sfp); mutt_unlink (filetosign); + if (intermediates != SmimeDefaultKey) + FREE (&intermediates); return NULL; } @@ -1439,6 +1444,8 @@ BODY *smime_sign_message (BODY *a ) safe_fclose (&smimeout); mutt_unlink (signedfile); mutt_unlink (filetosign); + if (intermediates != SmimeDefaultKey) + FREE (&intermediates); return NULL; } fputs (SmimePass, smimein);