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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: lib/worktree.c: fix use after free()
To:
Josh Rickmar <joshrickmar@outlook.com>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Thu, 21 Jan 2021 18:53:57 +0100

Download raw body.

Thread
On Thu, Jan 21, 2021 at 12:25:10PM -0500, Josh Rickmar wrote:
> On Thu, Jan 21, 2021 at 06:05:11PM +0100, Christian Weisgerber wrote:
> > fix a use after free()
> 
> ok jrick

Same here. Thanks!

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