Merge branch 'rs/fmt-merge-msg-string-leak-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 19:16:23 +0000 (11:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 19:16:23 +0000 (11:16 -0800)
Leakfix.

* rs/fmt-merge-msg-string-leak-fix:
  fmt-merge-msg: avoid leaking strbuf in shortlog()

builtin/fmt-merge-msg.c

index 22034f8..8e8a15e 100644 (file)
@@ -377,7 +377,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)