Skip to content

Commit ca52234

Browse files
pks-tgitster
authored andcommitted
transport: fix leaking OID arrays in git:// transport data
The transport data for the "git://" protocol contains two OID arrays that we never free, creating a memory leak. Plug them. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fb24460 commit ca52234

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

t/t5501-fetch-push-alternates.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ test_description='fetch/push involving alternates'
44
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

7+
TEST_PASSES_SANITIZE_LEAK=true
78
. ./test-lib.sh
89

910
count_objects () {

t/t5519-push-alternates.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='push to a repository that borrows from elsewhere'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./test-lib.sh
910

1011
test_expect_success setup '

transport.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,8 @@ static int disconnect_git(struct transport *transport)
946946
}
947947

948948
list_objects_filter_release(&data->options.filter_options);
949+
oid_array_clear(&data->extra_have);
950+
oid_array_clear(&data->shallow);
949951
free(data);
950952
return 0;
951953
}

0 commit comments

Comments
 (0)