summaryrefslogtreecommitdiff
path: root/tests/clar_libgit2.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-05-01 15:12:12 -0700
committerRussell Belfer <rb@github.com>2014-05-02 09:21:33 -0700
commit99dfa470398b9c4e06e5a5ee61868d3b9e21b26e (patch)
tree122084f6f31ce4e04377aa224d3a7ada6da4f3e9 /tests/clar_libgit2.c
parent0f603132bc2397bf8308e72651c56cb7dbd3ad70 (diff)
downloadlibgit2-99dfa470398b9c4e06e5a5ee61868d3b9e21b26e.tar.gz
Some further sandboxing cleanups to tests
Trying to find other issues where tests may not clean up quite properly when they are through...
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)