summaryrefslogtreecommitdiffstats
path: root/http.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-09-24 23:58:47 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-25 19:24:54 +0200
commitcb2732f0ca2bec372d02cb7ad5d823c0987bce2a (patch)
tree06e3e4b7735ed5621b38d85e977a2f80c278604b /http.c
parentfetch-pack: clear pack lockfiles list (diff)
downloadgit-cb2732f0ca2bec372d02cb7ad5d823c0987bce2a.tar.xz
git-cb2732f0ca2bec372d02cb7ad5d823c0987bce2a.zip
transport-helper: fix leak of dummy refs_list
When using a remote-helper, the fetch_refs() function will issue a "list" command if we haven't already done so. We don't care about the result, but this is just to maintain compatibility as explained in ac3fda82bf (transport-helper: skip ls-refs if unnecessary, 2019-08-21). But get_refs_list_using_list(), the function we call to issue the command, does parse and return the resulting ref list, which we simply leak. We should record the return value and free it immediately (another approach would be to teach it to avoid allocating at all, but it does not seem worth the trouble to micro-optimize this mostly historical case). Triggering this requires the v0 protocol (since in v2 we use stateless connect to take over the connection). You can see it in t5551.37, "fetch by SHA-1 without tag following", as it explicitly enables v0. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
0 files changed, 0 insertions, 0 deletions