Commit a25df009ef7f89fb8cbb26fb78e6c2e960a6c18b

Patrick Steinhardt 2017-03-28T08:38:24

Merge pull request #4180 from pks-t/pks/pass-blame-fix Fix memory leaks

diff --git a/src/blame_git.c b/src/blame_git.c
index 735b62d..6d2f153 100644
--- a/src/blame_git.c
+++ b/src/blame_git.c
@@ -547,7 +547,6 @@ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
 		if (porigin->blob && origin->blob &&
 		    !git_oid_cmp(git_blob_id(porigin->blob), git_blob_id(origin->blob))) {
 			error = pass_whole_blame(blame, origin, porigin);
-				goto finish;
 			origin_decref(porigin);
 			goto finish;
 		}
diff --git a/src/worktree.c b/src/worktree.c
index 393a088..55fbf52 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -212,8 +212,7 @@ int git_worktree_open_from_repository(git_worktree **out, git_repository *repo)
 		goto out;
 
 out:
-	if (error)
-		free(name);
+	free(name);
 	git_buf_free(&parent);
 
 	return error;