From: Thomas Roessler Date: Thu, 6 Mar 2003 21:23:53 +0000 (+0000) Subject: Fixing a segmentation fault. Here's how to reproduce it: Start X-Git-Tag: mutt-1-5-4-rel~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28ac70ee87137299351e8065a08903e001f89d0d;p=mutt Fixing a segmentation fault. Here's how to reproduce it: Start mutt. Compose a new message, with an attachment. Turn on PGP signing. Press C-G on the pass phrase prompt. Turn off PGP signing. Try to send the message. --- diff --git a/send.c b/send.c index f0d5a64b..c73e5576 100644 --- a/send.c +++ b/send.c @@ -1458,6 +1458,16 @@ main_loop: encode_descriptions (msg->content, 1); + /* + * Make sure that clear_content and free_clear_content are + * properly initialized -- we may visit this particular place in + * the code multiple times, including after a failed call to + * mutt_protect(). + */ + + clear_content = NULL; + free_clear_content = 0; + if (WithCrypto) { if (msg->security) @@ -1470,8 +1480,7 @@ main_loop: { msg->content = mutt_remove_multipart (msg->content); - if (pgpkeylist) - FREE (&pgpkeylist); + FREE (&pgpkeylist); decode_descriptions (msg->content); goto main_loop;