diff options
author | Jeff King <peff@peff.net> | 2024-09-24 18:06:38 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-25 10:24:57 -0700 |
commit | 7d3c71ddbf346bb5182d1cbb4610b9b575b34491 (patch) | |
tree | 23b938b9abe1aea0058a16328ffe045109ed0418 /commit.h | |
parent | 747a71019c49d41f46f70562102869e947d944ad (diff) |
http-push: free transfer_request dest field
When we issue a PUT request, we store the destination in the "dest"
field by detaching from a strbuf. But we never free the result, causing
a leak.
We can address this in the release_request() function. But note that we
also need to initialize it to NULL, as most other request types do not
set it at all.
Curiously there are _two_ functions to initialize a transfer_request
struct. Adding the initialization only to add_fetch_request() seems to
be enough for t5540, but I won't pretend to understand why. Rather than
just adding "request->dest = NULL" in both spots, let's zero the whole
struct. That addresses this problem, as well as any future ones (and it
can't possibly hurt, as by definition we'd be hitting uninitialized
memory previously).
This fixes several leaks noticed by t5540.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions