Skip to content

Commit 3b37315

Browse files
pks-tgitster
authored andcommitted
upload-pack: fix leaking URI protocols
We don't clear `struct upload_pack::uri_protocols`, which causes a memory leak. Fix this. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b20a28 commit 3b37315

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

t/t5702-protocol-v2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TEST_NO_CREATE_REPO=1
77
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
88
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
99

10+
TEST_PASSES_SANITIZE_LEAK=true
1011
. ./test-lib.sh
1112

1213
# Test protocol v2 with 'git://' transport

upload-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static void upload_pack_data_clear(struct upload_pack_data *data)
166166
object_array_clear(&data->extra_edge_obj);
167167
list_objects_filter_release(&data->filter_options);
168168
string_list_clear(&data->allowed_filters, 0);
169+
string_list_clear(&data->uri_protocols, 0);
169170

170171
free((char *)data->pack_objects_hook);
171172
}

0 commit comments

Comments
 (0)