Commit 793fcac3d46049fc9505ccf53b23af592bfdb963

Stefan Sperling 2021-09-24T20:14:09

plug memory leak in got_worktree_merge_in_progress(); spotted by tracey

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/worktree.c b/lib/worktree.c
index 84bdbf9..f5bc677 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -7657,6 +7657,7 @@ got_worktree_merge_in_progress(int *in_progress, struct got_worktree *worktree,
 	if (err)
 		return err;
 	err = got_ref_open(&branch_ref, repo, branch_refname, 0);
+	free(branch_refname);
 	if (err) {
 		if (err->code != GOT_ERR_NOT_REF)
 			return err;