Commit Diff


commit - 723721e290eec4393f8cad56a6bb38ca9fd379c7
commit + 8fd0d1965f6393cf1ae1776daee76543055e0dd8
blob - 4415674d74999e7b6fef5dd651fa76682cc19ca1
blob + 560592caa439af0f42f7fefe1abbe084f232c2bf
--- lib/worktree.c
+++ lib/worktree.c
@@ -3722,7 +3722,7 @@ free_ignores(struct got_pathlist_head *ignores)
 
 		got_pathlist_free(ignorelist, GOT_PATHLIST_FREE_PATH);
 	}
-	got_pathlist_free(ignores, GOT_PATHLIST_FREE_PATH);
+	got_pathlist_free(ignores, GOT_PATHLIST_FREE_ALL);
 }
 
 static const struct got_error *
@@ -3777,6 +3777,7 @@ done:
 	if (err || pe == NULL) {
 		free(dirpath);
 		got_pathlist_free(ignorelist, GOT_PATHLIST_FREE_PATH);
+		free(ignorelist);
 	}
 	return err;
 }