git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] merge: release strbuf after use in suggest_conflicts()
@ 2014-12-24  0:18 René Scharfe
  2014-12-24  2:11 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2014-12-24  0:18 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 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

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

* Re: [PATCH] merge: release strbuf after use in suggest_conflicts()
  2014-12-24  0:18 [PATCH] merge: release strbuf after use in suggest_conflicts() René Scharfe
@ 2014-12-24  2:11 ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2014-12-24  2:11 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git Mailing List, Junio C Hamano

René Scharfe wrote:

> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
>  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 <jrnieder@gmail.com>

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

end of thread, other threads:[~2014-12-24  2:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24  0:18 [PATCH] merge: release strbuf after use in suggest_conflicts() René Scharfe
2014-12-24  2:11 ` Jonathan Nieder

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).