if (b->parameter)
mutt_free_parameter (&b->parameter);
if (b->unlink && b->filename)
+ {
+ dprint (1, (debugfile, "mutt_free_body: Unlinking %s.\n", b->filename));
unlink (b->filename);
+ }
+ else if (b->filename)
+ dprint (1, (debugfile, "mutt_free_body: Not unlinking %s.\n", b->filename));
+
FREE (&b->filename);
FREE (&b->content);
FREE (&b->xtype);
FREE (p);
}
-void mutt_mktemp (char *s)
+void _mutt_mktemp (char *s, const char *src, int line)
{
snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++);
+ dprint (1, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
unlink (s);
}
}
unlink (pgperrfile);
-
+
if ((thepid = pgp_invoke_traditional (&pgpin, NULL, NULL,
-1, fileno (pgpout), fileno (pgperr),
pgpinfile, keylist, flags)) == -1)
void mutt_make_misc_reply_headers (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, ENVELOPE *curenv);
void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out);
void mutt_message_to_7bit (BODY *, FILE *);
-void mutt_mktemp (char *);
+#define mutt_mktemp(a) _mutt_mktemp (a, __FILE__, __LINE__)
+void _mutt_mktemp (char *, const char *, int);
void mutt_normalize_time (struct tm *);
void mutt_paddstr (int, const char *);
void mutt_parse_mime_message (CONTEXT *ctx, HEADER *);
BODY *pbody;
int i, killfrom = 0;
int fcc_error = 0;
+ int free_clear_content = 0;
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
BODY *save_content = NULL;
* - something else. In this case, it's the same as clear_content.
*/
+ /* This is ugly -- lack of "reporting back" from mutt_protect(). */
+
+ if (clear_content && (msg->content != clear_content)
+ && (msg->content->parts != clear_content))
+ free_clear_content = 1;
+
#endif /* HAVE_PGP */
if (!option (OPTNOCURSES) && !(flags & SENDMAILX))
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (msg->security & ENCRYPT)
- {
- /* cleanup structures from the first encryption */
- mutt_free_body (&clear_content);
FREE (&pgpkeylist);
- }
+
+ if (free_clear_content)
+ mutt_free_body (&clear_content);
#endif
if (flags & SENDREPLY)