Commit 5546d4669ccce281a6f6f89ccf204e671ed0d3a9

Stefan Sperling 2021-09-02T19:39:14

plug a memory leak in check_merge_ok()

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/worktree.c b/lib/worktree.c
index 70cbc4d..821074b 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -3144,6 +3144,7 @@ check_merge_ok(void *arg, struct got_fileindex_entry *ie)
 
 	/* Reject merges into a work tree with conflicted files. */
 	err = get_file_status(&status, &sb, ie, ondisk_path, -1, NULL, a->repo);
+	free(ondisk_path);
 	if (err)
 		return err;
 	if (status == GOT_STATUS_CONFLICT)