mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +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:
parent
8bdb84ebbb
commit
75f4acc981
2 changed files with 2 additions and 0 deletions
1
http.c
1
http.c
|
@ -2475,6 +2475,7 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
free(url);
|
free(url);
|
||||||
|
strbuf_release(&buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
test_description='test local clone with ambiguous transport'
|
test_description='test local clone with ambiguous transport'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY/lib-httpd.sh"
|
. "$TEST_DIRECTORY/lib-httpd.sh"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue