Skip to content

Commit 75f4acc

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8bdb84e commit 75f4acc

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

http.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,7 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
24752475

24762476
cleanup:
24772477
free(url);
2478+
strbuf_release(&buf);
24782479
return ret;
24792480
}
24802481

t/t5619-clone-local-ambiguous-transport.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='test local clone with ambiguous transport'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67
. "$TEST_DIRECTORY/lib-httpd.sh"
78

0 commit comments

Comments
 (0)