1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-18 17:50:24 +02:00

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:
René Scharfe 2017-12-07 21:22:49 +01:00 committed by Junio C Hamano
parent 9752ad0bb7
commit addcf6cfde

View File

@ -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)