summaryrefslogtreecommitdiff
path: root/tests/clar_libgit2.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/clar_libgit2.c')
-rw-r--r--tests/clar_libgit2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index 9ec9a6419..f457adb33 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -493,9 +493,11 @@ void cl_fake_home_cleanup(void *payload)
GIT_UNUSED(payload);
- cl_git_pass(git_libgit2_opts(
- GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, restore));
- git__free(restore);
+ if (restore) {
+ cl_git_pass(git_libgit2_opts(
+ GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, restore));
+ git__free(restore);
+ }
}
void cl_fake_home(void)