1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

http: stop leaking buffer in http_get_info_packs()

We use http_get_strbuf() to fetch the remote info/packs content into a
strbuf, but never free it, causing a leak. There's no need to hold onto
it, as we've already parsed it completely.

This lets us mark t5619 as leak-free.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2024-09-24 18:02:27 -04:00 committed by Junio C Hamano
parent 8bdb84ebbb
commit 75f4acc981
2 changed files with 2 additions and 0 deletions

1
http.c
View file

@ -2475,6 +2475,7 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
cleanup:
free(url);
strbuf_release(&buf);
return ret;
}

View file

@ -2,6 +2,7 @@
test_description='test local clone with ambiguous transport'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY/lib-httpd.sh"