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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



René Scharfe wrote:

> Signed-off-by: Rene Scharfe <l.s.r@xxxxxx>
> ---
>  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@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]