commit - ec405b99414136a277c6d2bc223a538d9d701ccc
commit + a854b8c994a1381e4c6f2ba45bef9c22da0ec956
blob - fc674d163162822cb326fcd1144a79b40778c452
blob + f3dd65c0798d2e84fb8a2d174be5c350115e06a1
--- lib/worktree.c
+++ lib/worktree.c
*commit_id = NULL;
*tmp_branch = NULL;
+ *branch_ref = NULL;
*base_commit_id = NULL;
*fileindex = NULL;
got_ref_close(*tmp_branch);
*tmp_branch = NULL;
}
+ if (*branch_ref) {
+ got_ref_close(*branch_ref);
+ *branch_ref = NULL;
+ }
if (*fileindex) {
got_fileindex_free(*fileindex);
*fileindex = NULL;