Unverified Commit 232dd4de by Patrick Steinhardt Committed by GitHub

Merge pull request #4635 from tiennou/fix/leaks-v0.27.1

Leak fixes for v0.27.1
parents 8d138f89 df4937b8
......@@ -237,7 +237,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
goto on_error;
/* only write for non-anonymous remotes */
if (name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
if (repo && name && (error = write_add_refspec(repo, name, fetch, true)) < 0)
goto on_error;
if (repo && (error = lookup_remote_prune_config(remote, config_ro, name)) < 0)
......
......@@ -512,8 +512,10 @@ static int foreach_reference_cb(git_reference *reference, void *payload)
git_revwalk *walk = (git_revwalk *)payload;
int error;
if (git_reference_type(reference) != GIT_REF_OID)
if (git_reference_type(reference) != GIT_REF_OID) {
git_reference_free(reference);
return 0;
}
error = git_revwalk_hide(walk, git_reference_target(reference));
/* The reference is in the local repository, so the target may not
......
......@@ -131,7 +131,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
goto out;
}
if ((wt = git__calloc(1, sizeof(struct git_repository))) == NULL) {
if ((wt = git__calloc(1, sizeof(*wt))) == NULL) {
error = -1;
goto out;
}
......
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