]> granicus.if.org Git - neomutt/commitdiff
fix resource leaks
authorRichard Russon <rich@flatcap.org>
Fri, 15 Dec 2017 14:32:23 +0000 (14:32 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 28 Dec 2017 13:40:11 +0000 (13:40 +0000)
attach.c
nntp.c

index 93f8c209281cb544b0202f551571408e8a33f012..6fab3a185539e626e9b6357c76d3232b9e15f327 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -185,6 +185,7 @@ int mutt_compose_attachment(struct Body *a)
             if (!tfp)
             {
               mutt_perror(_("Failure to open file to strip headers."));
+              mutt_file_fclose(&fp);
               goto bailout;
             }
             mutt_file_copy_stream(fp, tfp);
diff --git a/nntp.c b/nntp.c
index fa5add0770265ce0544cd0fd8ee45e28c3ede8de..c934f048a029dd1985d220cd589cc615e08f8c47 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -1779,7 +1779,10 @@ int nntp_post(const char *msg)
     }
     if (mutt_socket_write_d(nntp_data->nserv->conn, buf[1] == '.' ? buf : buf + 1,
                             -1, MUTT_SOCK_LOG_HDR) < 0)
+    {
+      mutt_file_fclose(&fp);
       return nntp_connect_error(nntp_data->nserv);
+    }
   }
   mutt_file_fclose(&fp);