builtin/submodule--helper: fix leaking refs on push-check
In the push-check subcommand of the submodule helper we acquire a list of local refs, but never free that list. Fix this memory leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
3eefd348e5
commit
1e8cb17ac5
@ -2958,7 +2958,9 @@ static int push_check(int argc, const char **argv, const char *prefix UNUSED)
|
|||||||
rs->src);
|
rs->src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refspec_clear(&refspec);
|
refspec_clear(&refspec);
|
||||||
|
free_refs(local_refs);
|
||||||
}
|
}
|
||||||
free(head);
|
free(head);
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
|||||||
GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
|
GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
|
||||||
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
|
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
Reference in New Issue
Block a user