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

From: Jonathan Nieder <[email-masked]>
Date: Tue, 23 Dec 2014 18:11:55 -0800

René Scharfe wrote:

> Signed-off-by: Rene Scharfe <[email-masked]>
> ---
>  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 <[email-masked]>