]> granicus.if.org Git - neomutt/commitdiff
fix: resource leak - CID 76976
authorRichard Russon <rich@flatcap.org>
Thu, 16 Feb 2017 12:25:29 +0000 (12:25 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 20 Feb 2017 16:31:03 +0000 (16:31 +0000)
attach.c

index ab8919bc22b5e589acfa6ad3f768a6612a3a3cda..9cb2f937bc3dc91bd865e1b475de41d49cda6b25 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -47,13 +47,13 @@ int mutt_get_tmp_attachment (BODY *a)
 {
   char type[STRING];
   char tempfile[_POSIX_PATH_MAX];
-  rfc1524_entry *entry = rfc1524_new_entry();
   FILE *fpin = NULL, *fpout = NULL;
   struct stat st;
   
   if(a->unlink)
     return 0;
 
+  rfc1524_entry *entry = rfc1524_new_entry();
   snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
   rfc1524_mailcap_lookup(a, type, entry, 0);
   rfc1524_expand_filename(entry->nametemplate, a->filename,