diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:08 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:08 +0900 |
commit | 6da2d14c8bd4105bd123dd82840915197f4c3442 (patch) | |
tree | cc988757f7bdb6a5da3eee53ff5be3a787110514 | |
parent | 96d14cbb91a2f4493f30c4caeb4ffff906c43be8 (diff) | |
parent | 150efef1e7252452fb5910adfb9b1e57270c3c15 (diff) | |
download | git-6da2d14c8bd4105bd123dd82840915197f4c3442.tar.gz |
Merge branch 'ma/pkt-line-leakfix' into maint
A leakfix.
* ma/pkt-line-leakfix:
pkt-line: re-'static'-ify buffer in packet_write_fmt_1()
-rw-r--r-- | pkt-line.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c index 7db9119573..f364944b93 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -136,9 +136,10 @@ static void format_packet(struct strbuf *out, const char *fmt, va_list args) static int packet_write_fmt_1(int fd, int gently, const char *fmt, va_list args) { - struct strbuf buf = STRBUF_INIT; + static struct strbuf buf = STRBUF_INIT; ssize_t count; + strbuf_reset(&buf); format_packet(&buf, fmt, args); count = write_in_full(fd, buf.buf, buf.len); if (count == buf.len) |