format_config: don't init strbuf
commit9f1429df179adb7a315616d01c9b237b521a3733
authorJeff King <peff@peff.net>
Thu, 20 Aug 2015 14:46:04 +0000 (20 10:46 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Aug 2015 20:16:50 +0000 (20 13:16 -0700)
tree455bded9f9cf71ccb3023df97d65eeadfd4c95bc
parentebca2d49577665db0318a9c91c0bcca7e4eed963
format_config: don't init strbuf

It's unusual for a function which writes to a passed-in
strbuf to call strbuf_init; that will throw away anything
already there, leaking memory. In this case, there are
exactly two callers; one relies on this initialization and
the other passes in an already-initialized buffer.

There's no leak, as the initialized buffer doesn't have
anything in it. But let's bump the strbuf_init out to the
one caller who needs it, making format_config more
idiomatic.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c