Skip to content

Commit 94d24ac

Browse files
committed
Merge pull request libgit2#1573 from nulltoken/fix/leaks
Fix some memory leaks
2 parents ae59321 + 2498889 commit 94d24ac

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests-clar/clone/nonetwork.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ void test_clone_nonetwork__custom_autotag(void)
185185
cl_assert_equal_i(GIT_REMOTE_DOWNLOAD_TAGS_NONE, origin->download_tags);
186186

187187
git_strarray_free(&tags);
188+
git_remote_free(origin);
188189
}
189190

190191
void test_clone_nonetwork__custom_autotag_tags_all(void)
@@ -199,6 +200,7 @@ void test_clone_nonetwork__custom_autotag_tags_all(void)
199200
cl_assert_equal_i(GIT_REMOTE_DOWNLOAD_TAGS_ALL, origin->download_tags);
200201

201202
git_strarray_free(&tags);
203+
git_remote_free(origin);
202204
}
203205

204206
void test_clone_nonetwork__cope_with_already_existing_directory(void)

tests-clar/refs/branches/upstream.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ void test_refs_branches_upstream__set_unset_upstream(void)
113113
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));
114114
cl_assert_equal_s(value, "refs/heads/master");
115115

116+
git_reference_free(branch);
117+
116118
/* local */
117119
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test"));
118120
cl_git_pass(git_branch_set_upstream(branch, "master"));
119121

120-
cl_git_pass(git_repository_config(&config, repository));
121122
cl_git_pass(git_config_get_string(&value, config, "branch.test.remote"));
122123
cl_assert_equal_s(value, ".");
123124
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));

0 commit comments

Comments
 (0)