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

From:
Josh Rickmar <joshrickmar@outlook.com>
Subject:
Re: lib/worktree.c: fix use after free()
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 21 Jan 2021 12:25:10 -0500

Download raw body.

Thread
On Thu, Jan 21, 2021 at 06:05:11PM +0100, Christian Weisgerber wrote:
> fix a use after free()

ok jrick

> 
> 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
>