Commit Diff


commit - 44d79efab98b7f1502b7d4a5b66e5890f16180d8
commit + 58041363b15268c10af599e8fde0065ad975f554
blob - d30cb1e2b1c1640f98f1f45f52aef50128ad5bea
blob + 39d94b689a7e9421e20d46f7f02e9b4e9fede796
--- got/got.c
+++ got/got.c
@@ -3679,6 +3679,8 @@ done:
 		if (error == NULL)
 			error = close_err;
 	}
+	if (head_ref != NULL)
+		got_ref_close(head_ref);
 	free(worktree_path);
 	got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
 	free(commit_id);