connected.c: free the "struct packed_git"
The "new_pack" we allocate in check_connected() wasn't being
free'd. Let's do that before we return from the function. This has
leaked ever since "new_pack" was added to this function in
c6807a40dc
(clone: open a shortcut for connectivity check,
2013-05-26).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
parent
f1f4ebf432
commit
dd4143e7bf
@ -85,6 +85,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
|
||||
promisor_pack_found:
|
||||
;
|
||||
} while ((oid = fn(cb_data)) != NULL);
|
||||
free(new_pack);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -118,8 +119,10 @@ no_promisor_pack_found:
|
||||
else
|
||||
rev_list.no_stderr = opt->quiet;
|
||||
|
||||
if (start_command(&rev_list))
|
||||
if (start_command(&rev_list)) {
|
||||
free(new_pack);
|
||||
return error(_("Could not run 'git rev-list'"));
|
||||
}
|
||||
|
||||
sigchain_push(SIGPIPE, SIG_IGN);
|
||||
|
||||
@ -151,5 +154,6 @@ no_promisor_pack_found:
|
||||
err = error_errno(_("failed to close rev-list's stdin"));
|
||||
|
||||
sigchain_pop(SIGPIPE);
|
||||
free(new_pack);
|
||||
return finish_command(&rev_list) || err;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
test_description='fetching and pushing project with subproject'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
test_description='behavior of diff when reading objects in a partial clone'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'git show batches blobs' '
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='test custom script in place of pack-objects'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'create some history to fetch' '
|
||||
|
@ -4,6 +4,7 @@ test_description='test cloning a repository with detached HEAD'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
head_is_detached() {
|
||||
|
@ -4,6 +4,7 @@ test_description='tests for git clone -c key=value'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'clone -c sets config in cloned repo' '
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
test_description='Test shallow cloning of repos with submodules'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
pwd=$(pwd)
|
||||
|
@ -5,6 +5,7 @@ test_description='Test cloning repos with submodules using remote-tracking branc
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
pwd=$(pwd)
|
||||
|
Loading…
Reference in New Issue
Block a user