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
This commit is contained in:
Poul-Henning Kamp 1997-04-13 06:27:09 +00:00
parent 9fa6ee7671
commit b422956c56
2 changed files with 10 additions and 2 deletions

View File

@ -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 <sys/param.h>
@ -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);
}

View File

@ -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 <sys/param.h>
@ -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);
}