git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 24, 2014, 02:11 UTC
Message-ID
<20141224021155.GD29365@google.com>
In-Reply-To
<549A065E.8060008@web.de>
René Scharfe wrote:
Show 17 quoted lines
> 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>
Previous: René Scharfe
Message 2 of 2 in “merge: release strbuf after use in suggest_conflicts()”
  1. merge: release strbuf after use in suggest_conflicts()René Scharfe, Dec 24, 2014
  2. Jonathan NiederDec 24, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.