From owner-freebsd-hackers Mon Sep 18 02:53:58 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id CAA10477 for hackers-outgoing; Mon, 18 Sep 1995 02:53:58 -0700 Received: from gilberto.physik.RWTH-Aachen.DE (gilberto.physik.rwth-aachen.de [137.226.31.2]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id CAA10467 ; Mon, 18 Sep 1995 02:53:43 -0700 Received: (from kuku@localhost) by gilberto.physik.RWTH-Aachen.DE (8.6.11/8.6.9) id KAA08948; Mon, 18 Sep 1995 10:43:13 +0200 Message-Id: <199509180843.KAA08948@gilberto.physik.RWTH-Aachen.DE> Subject: Re: why is this not a bug in namei? To: julian@freefall.freebsd.org (Julian Elischer) Date: Mon, 18 Sep 1995 10:43:12 +0200 (MET DST) Cc: hackers@freefall.freebsd.org In-Reply-To: <199509180640.XAA05368@freefall.freebsd.org> from "Julian Elischer" at Sep 17, 95 11:40:19 pm From: Christoph Kukulies Reply-To: Christoph Kukulies X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1279 Sender: owner-hackers@FreeBSD.org Precedence: bulk > > > if ((cnp->cn_flags & HASBUF) == 0) > MALLOC(cnp->cn_pnbuf, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK); > [....] > > if (error) { > free(cnp->cn_pnbuf, M_NAMEI); ^^^^ Is this just a typo? Shouldn't it be a FREE() macro like below? > ndp->ni_vp = NULL; > return (error); > [...] > if (error) { > FREE(cnp->cn_pnbuf, M_NAMEI); > return (error); > [....] (and more confusingly) > if ((cnp->cn_flags & ISSYMLINK) == 0) { > if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) > FREE(cnp->cn_pnbuf, M_NAMEI); > else > cnp->cn_flags |= HASBUF; > return (0); > } > [....] > FREE(cnp->cn_pnbuf, M_NAMEI); > } > > if HASBUF was set, we have freed something we didn't allocate.. > (whenever we get an error, by the looks of it..) > > luckily I can't actually see anywhere that HASBUF is used > (can anyone?) but it looks wrong to me... > > > > julian > --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de