diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-19 04:47:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-19 04:47:52 +0300 |
commit | c78e182d55b96b40729be83e55999a93e1499a4c (patch) | |
tree | 8a2a8c344b70a6b4563cafc9a5a0e65865c2d9f5 | |
parent | b0727e2439abb8a87a7d1ad1e57032830086a390 (diff) | |
parent | 150efef1e7252452fb5910adfb9b1e57270c3c15 (diff) |
Merge branch 'ma/pkt-line-leakfix'
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) |