Date: Sat, 12 Apr 1997 16:14:37 +0900 (JST) From: kato@eclogite.eps.nagoya-u.ac.jp To: FreeBSD-gnats-submit@freebsd.org Subject: kern/3262: memory leak of pathname buffer Message-ID: <199704120714.QAA03968@marble.eps.nagoya-u.ac.jp> Resent-Message-ID: <199704120720.AAA18898@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 3262
>Category: kern
>Synopsis: memory leak in union_relookup
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 12 00:20:01 PDT 1997
>Last-Modified:
>Originator: KATO Takenori
>Organization:
Dept. Earth Planet. Sci, Nagoya Univ.
>Release: FreeBSD 3.0-CURRENT i386
>Environment:
>Description:
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.
>How-To-Repeat:
>Fix:
---------- BEGIN ----------
*** union_subr.c.ORIG Sat Apr 12 16:03:51 1997
--- union_subr.c Sat Apr 12 16:04:57 1997
***************
*** 752,757 ****
--- 752,761 ----
error = relookup(dvp, vpp, cn);
if (!error)
vrele(dvp);
+ else {
+ free(cn->cn_pnbuf, M_NAMEI);
+ cn->cn_pnbuf = '\0';
+ }
return (error);
}
---------- END ----------
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704120714.QAA03968>
