git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] am: plug small memory leak when split_mail_stgit_series() fails
@ 2016-05-11 23:35 Junio C Hamano
  2016-05-11 23:35 ` [PATCH 2/2] am: plug FILE * leak in split_mail_conv() Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2016-05-11 23:35 UTC (permalink / raw)
  To: git

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/am.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/am.c b/builtin/am.c
index ec75906..f1a84c6 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -842,9 +842,11 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
 	series_dir = dirname(series_dir_buf);
 
 	fp = fopen(*paths, "r");
-	if (!fp)
+	if (!fp) {
+		free(series_dir_buf);
 		return error(_("could not open '%s' for reading: %s"), *paths,
 				strerror(errno));
+	}
 
 	while (!strbuf_getline(&sb, fp, '\n')) {
 		if (*sb.buf == '#')
-- 
2.8.2-679-g91c6421

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-05-12 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-11 23:35 [PATCH 1/2] am: plug small memory leak when split_mail_stgit_series() fails Junio C Hamano
2016-05-11 23:35 ` [PATCH 2/2] am: plug FILE * leak in split_mail_conv() Junio C Hamano
2016-05-12  4:47   ` Jeff King
2016-05-12  5:23     ` Mikael Magnusson
2016-05-12  5:29       ` Jeff King
2016-05-12  7:59     ` Eric Wong
2016-05-12  8:03       ` Jeff King
2016-05-12 15:59     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).