aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shallow.c9
-rwxr-xr-xt/t5538-push-shallow.sh1
2 files changed, 10 insertions, 0 deletions
diff --git a/shallow.c b/shallow.c
index 7e0ee96ead..dcebc263d7 100644
--- a/shallow.c
+++ b/shallow.c
@@ -489,6 +489,15 @@ void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
void clear_shallow_info(struct shallow_info *info)
{
+ if (info->used_shallow) {
+ for (size_t i = 0; i < info->shallow->nr; i++)
+ free(info->used_shallow[i]);
+ free(info->used_shallow);
+ }
+
+ free(info->need_reachability_test);
+ free(info->reachable);
+ free(info->shallow_ref);
free(info->ours);
free(info->theirs);
}
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index e91fcc173e..6adc3a20a4 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -5,6 +5,7 @@ test_description='push from/to a shallow clone'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
commit() {