[PATCH] merge: release strbuf after use in suggest_conflicts()

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] merge: release strbuf after use in suggest_conflicts()

From: René Scharfe <hidden>
Date: 2016-06-15 23:03:21

Signed-off-by: Rene Scharfe <redacted>
---
 builtin/merge.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/merge.c b/builtin/merge.c
index 215d485..d722889 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -894,6 +894,7 @@ static int suggest_conflicts(void)
 
 	append_conflicts_hint(&msgbuf);
 	fputs(msgbuf.buf, fp);
+	strbuf_release(&msgbuf);
 	fclose(fp);
 	rerere(allow_rerere_auto);
 	printf(_("Automatic merge failed; "
-- 
2.2.1

Re: [PATCH] merge: release strbuf after use in suggest_conflicts()

From: Jonathan Nieder <hidden>
Date: 2016-06-15 23:03:21

René Scharfe wrote:
quoted hunk
Signed-off-by: Rene Scharfe <redacted>
---
 builtin/merge.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/merge.c b/builtin/merge.c
index 215d485..d722889 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -894,6 +894,7 @@ static int suggest_conflicts(void)
 
 	append_conflicts_hint(&msgbuf);
 	fputs(msgbuf.buf, fp);
+	strbuf_release(&msgbuf);
 	fclose(fp);
 	rerere(allow_rerere_auto);
 	printf(_("Automatic merge failed; "
The caller is about to exit so this is a small one-time leak, but
freeing it doesn't cost much and makes analysis by valgrind
a little easier.  So this seems like a good change.

Reviewed-by: Jonathan Nieder <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help