diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-09-01 09:19:22 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2015-09-01 09:19:22 +0000 |
commit | fe0c2896276641a31718f4215a2b8b2b45840dd8 (patch) | |
tree | 841e02e53cdc590af0e074c3def4a407b5ae17af /sys/kern | |
parent | a0bddd91c5f29af3fdaef087cbed805c2ac13e8c (diff) |
Corrects a use-after-free in tame_namei().
ok doug@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_tame.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_tame.c b/sys/kern/kern_tame.c index 39cdde0793e..0e07060c8d8 100644 --- a/sys/kern/kern_tame.c +++ b/sys/kern/kern_tame.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tame.c,v 1.35 2015/08/31 16:17:53 deraadt Exp $ */ +/* $OpenBSD: kern_tame.c,v 1.36 2015/09/01 09:19:21 semarie Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -569,9 +569,9 @@ tame_namei(struct proc *p, char *origpath) error = 0; } } - free(canopath, M_TEMP, MAXPATHLEN); if (error) printf("bad path: %s\n", canopath); + free(canopath, M_TEMP, MAXPATHLEN); return (error); /* Don't hint why it failed */ } |