Commit b97fabfa by nulltoken

tests: Fix some memory leaks

parent d1aee477
...@@ -67,6 +67,9 @@ void test_checkout_tree__can_checkout_and_remove_directory(void) ...@@ -67,6 +67,9 @@ void test_checkout_tree__can_checkout_and_remove_directory(void)
cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt")); cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt"));
cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/fgh/1.txt")); cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/fgh/1.txt"));
git_object_free(g_object);
g_object = NULL;
/* Checkout brach "master" and update HEAD, so that HEAD matches the /* Checkout brach "master" and update HEAD, so that HEAD matches the
* current working tree * current working tree
*/ */
...@@ -136,6 +139,9 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void) ...@@ -136,6 +139,9 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void)
opts.checkout_strategy = GIT_CHECKOUT_NONE; opts.checkout_strategy = GIT_CHECKOUT_NONE;
git_checkout_tree(g_repo, (git_object*)p_chomped_commit, &opts); git_checkout_tree(g_repo, (git_object*)p_chomped_commit, &opts);
cl_assert_equal_i(false, git_path_isfile("testrepo/readme.txt")); cl_assert_equal_i(false, git_path_isfile("testrepo/readme.txt"));
git_commit_free(p_master_commit);
git_commit_free(p_chomped_commit);
} }
void test_checkout_tree__can_switch_branches(void) void test_checkout_tree__can_switch_branches(void)
......
...@@ -144,6 +144,8 @@ void test_clone_nonetwork__custom_autotag(void) ...@@ -144,6 +144,8 @@ void test_clone_nonetwork__custom_autotag(void)
cl_git_pass(git_tag_list(&tags, g_repo)); cl_git_pass(git_tag_list(&tags, g_repo));
cl_assert_equal_i(0, tags.count); cl_assert_equal_i(0, tags.count);
git_strarray_free(&tags);
} }
void test_clone_nonetwork__cope_with_already_existing_directory(void) void test_clone_nonetwork__cope_with_already_existing_directory(void)
......
...@@ -18,4 +18,6 @@ void test_config_backend__checks_version(void) ...@@ -18,4 +18,6 @@ void test_config_backend__checks_version(void)
cl_git_fail(git_config_add_backend(cfg, &backend, 0, false)); cl_git_fail(git_config_add_backend(cfg, &backend, 0, false));
err = giterr_last(); err = giterr_last();
cl_assert_equal_i(GITERR_INVALID, err->klass); cl_assert_equal_i(GITERR_INVALID, err->klass);
git_config_free(cfg);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment