fmt-merge-msg: avoid leaking strbuf in shortlog()
Use string_list_append_nodup() instead of string_list_append() to hand over ownership of a detached strbuf and thus avoid leaking its memory. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9752ad0bb7
commit
addcf6cfde
@ -376,7 +376,8 @@ static void shortlog(const char *name,
|
||||
string_list_append(&subjects,
|
||||
oid_to_hex(&commit->object.oid));
|
||||
else
|
||||
string_list_append(&subjects, strbuf_detach(&sb, NULL));
|
||||
string_list_append_nodup(&subjects,
|
||||
strbuf_detach(&sb, NULL));
|
||||
}
|
||||
|
||||
if (opts->credit_people)
|
||||
|
Loading…
Reference in New Issue
Block a user