Commit Diff


commit - 863cc633e270c0edf587982ac9faccf7bb28f339
commit + f47e2be5099a39b598f7b96d26b4fa08fdb62374
blob - ff960485254894c4b8c41fda56a2319bc2b89b17
blob + dae05a53000410c2bf66f6696b63f8af1312036e
--- got/got.c
+++ got/got.c
@@ -3680,6 +3680,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);