From 74f4a712fc83c1a0586e6e716cfb40857db28817 Mon Sep 17 00:00:00 2001 From: Marco Sirabella Date: Fri, 22 Jun 2018 12:52:06 -0400 Subject: [PATCH] Remove tempfile from pgp_class_encrypted_handler --- ncrypt/pgp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index b77a56e5b..8115bfac4 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1119,15 +1119,14 @@ bail: */ int pgp_class_encrypted_handler(struct Body *a, struct State *s) { - char tempfile[PATH_MAX]; FILE *fpin = NULL; struct Body *tattach = NULL; int rc = 0; - mutt_mktemp(tempfile, sizeof(tempfile)); - FILE *fpout = mutt_file_fopen(tempfile, "w+"); + FILE *fpout = mutt_file_mkstemp(); if (!fpout) { + mutt_perror("mutt_file_mkstemp() failed!"); if (s->flags & MUTT_DISPLAY) state_attach_puts(_("[-- Error: could not create temporary file! --]\n"), s); return -1; @@ -1179,7 +1178,6 @@ int pgp_class_encrypted_handler(struct Body *a, struct State *s) } mutt_file_fclose(&fpout); - mutt_file_unlink(tempfile); return rc; } -- 2.40.0