diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-19 03:47:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-19 03:47:52 +0200 |
commit | c78e182d55b96b40729be83e55999a93e1499a4c (patch) | |
tree | 8a2a8c344b70a6b4563cafc9a5a0e65865c2d9f5 /pkt-line.c | |
parent | Merge branch 'jk/config-lockfile-leak-fix' (diff) | |
parent | pkt-line: re-'static'-ify buffer in packet_write_fmt_1() (diff) | |
download | git-c78e182d55b96b40729be83e55999a93e1499a4c.tar.xz git-c78e182d55b96b40729be83e55999a93e1499a4c.zip |
Merge branch 'ma/pkt-line-leakfix'
A leakfix.
* ma/pkt-line-leakfix:
pkt-line: re-'static'-ify buffer in packet_write_fmt_1()
Diffstat (limited to 'pkt-line.c')
-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) |