diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:29 -0700 |
commit | ffa604510282f796630465b46979f81632cbb868 (patch) | |
tree | 9bfc50e4502c51af6dabec34dc20b20a311a3072 | |
parent | Merge branch 'es/walken-tutorial-fix' into maint (diff) | |
parent | protocol-caps.c: fix memory leak in send_info() (diff) | |
download | tgif-ffa604510282f796630465b46979f81632cbb868.tar.xz |
Merge branch 'ba/object-info' into maint
Leakfix.
* ba/object-info:
protocol-caps.c: fix memory leak in send_info()
-rw-r--r-- | protocol-caps.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/protocol-caps.c b/protocol-caps.c index 13a9e63a04..901b6795e4 100644 --- a/protocol-caps.c +++ b/protocol-caps.c @@ -69,9 +69,10 @@ static void send_info(struct repository *r, struct packet_writer *writer, } } - packet_writer_write(writer, "%s", - strbuf_detach(&send_buffer, NULL)); + packet_writer_write(writer, "%s", send_buffer.buf); + strbuf_reset(&send_buffer); } + strbuf_release(&send_buffer); } int cap_object_info(struct repository *r, struct strvec *keys, |