"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
lib/worktree.c: fix use after free()
To:
gameoftrees@openbsd.org
Date:
Thu, 21 Jan 2021 18:05:11 +0100

Download raw body.

Thread
fix a use after free()

diff 56d0a75325a6ada09ad4f1c586f7fde7971b52f6 /home/naddy/got
blob - 5dfe5fbfdef7f0419e78c3302df7d292acfa2f2e
file + lib/worktree.c
--- lib/worktree.c
+++ 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;
 }
 
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de