From 69934522f723a52b4a83a27a0996b92a17c0a9a2 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 13 Apr 1997 06:27:09 +0000 Subject: The path name buffer, cn->cn_pnbuf, is FREEed by VOP_MKDIR when relookup() in union_relookup() is succeeded. However, if relookup() returns non-zero value, that is relookup fails, VOP_MKDIR is never called (c.f. union_mkshadow). Thus, pathname buffer is never FREEed. Reviewed by: phk Submitted by: kato PR: 3262 --- sys/fs/unionfs/union_subr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/fs') diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 8868b2a..e37593d 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 - * $Id: union_subr.c,v 1.15 1997/03/23 03:36:59 bde Exp $ + * $Id: union_subr.c,v 1.16 1997/04/13 06:25:03 phk Exp $ */ #include @@ -752,6 +752,10 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen) error = relookup(dvp, vpp, cn); if (!error) vrele(dvp); + else { + free(cn->cn_pnbuf, M_NAMEI); + cn->cn_pnbuf = '\0'; + } return (error); } -- cgit v1.1