Unverified Commit 0ad2372b by Patrick Steinhardt Committed by GitHub

Merge pull request #4636 from tiennou/fix/leaks

Fix leaks in master
parents 232dd4de 25100d6d
...@@ -304,6 +304,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs) ...@@ -304,6 +304,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
git_buf buf = GIT_BUF_INIT; git_buf buf = GIT_BUF_INIT;
size_t j, pos; size_t j, pos;
git_remote_head key; git_remote_head key;
git_refspec *cur;
const char* formatters[] = { const char* formatters[] = {
GIT_REFS_DIR "%s", GIT_REFS_DIR "%s",
...@@ -312,7 +313,9 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs) ...@@ -312,7 +313,9 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
NULL NULL
}; };
git_refspec *cur = git__calloc(1, sizeof(git_refspec)); assert(out && spec && refs);
cur = git__calloc(1, sizeof(git_refspec));
GITERR_CHECK_ALLOC(cur); GITERR_CHECK_ALLOC(cur);
cur->force = spec->force; cur->force = spec->force;
......
...@@ -300,6 +300,7 @@ void test_worktree_worktree__add_with_explicit_branch(void) ...@@ -300,6 +300,7 @@ void test_worktree_worktree__add_with_explicit_branch(void)
git_reference_free(branch); git_reference_free(branch);
git_reference_free(wthead); git_reference_free(wthead);
git_repository_free(wtrepo); git_repository_free(wtrepo);
git_worktree_free(wt);
} }
......
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