Thread (4 messages) 4 messages, 2 authors, 2017-12-08

Re: [PATCH] fmt-merge-msg: avoid leaking strbuf in shortlog()

flat view

From: Jeff King <hidden>
Date: 2017-12-07 21:27:51

On Thu, Dec 07, 2017 at 09:22:49PM +0100, René Scharfe wrote:
Use string_list_append_nodup() instead of string_list_append() to hand
over ownership of a detached strbuf and thus avoid leaking its memory.
Looks obviously correct (though one thing missing from the diff context
is whether "subjects" is set to DUP -- it is, which is good).

Grepping for "list_append.*detach" shows a few other possible cases in
transport-helper.c, which I think are leaks.

I wondered if it would be possible to write a coccinelle rule for this,
but I think it's not possible. Whether this is right depends on the
strdup_strings flag, which could change at runtime (though in practice
it doesn't).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help