Commit fbdf2a79d5b6f3f4c9a7abdd971f9f3cb133e157

Patrick Steinhardt 2017-03-24T09:26:31

worktree: unconditionally free the worktree's name

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;