fix a use after free() ok jrick stsp
diff --git a/lib/worktree.c b/lib/worktree.c
index 5dfe5fb..f846908 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -510,8 +510,8 @@ got_worktree_close(struct got_worktree *worktree)
free(worktree->root_path);
free(worktree->gotconfig_path);
got_gotconfig_free(worktree->gotconfig);
- free(worktree);
close(worktree->root_fd);
+ free(worktree);
return err;
}