summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-01-27 11:19:53 +0000
committerpjd <pjd@FreeBSD.org>2006-01-27 11:19:53 +0000
commitbc66ded70e322090fbb76b55f6b7f4d009959d0c (patch)
treef9308ad9358d40240445389690eed70b3f30d5b1
parentac52c99fe4dea5e12a1c96d5011b3c876e0f3cc2 (diff)
downloadFreeBSD-src-bc66ded70e322090fbb76b55f6b7f4d009959d0c.zip
FreeBSD-src-bc66ded70e322090fbb76b55f6b7f4d009959d0c.tar.gz
Don't forget to call NDFREE(9) in case of vn_open_cred() failure.
MFC after: 3 days
-rw-r--r--sys/kern/kern_alq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c
index 3617afe..089febe 100644
--- a/sys/kern/kern_alq.c
+++ b/sys/kern/kern_alq.c
@@ -354,10 +354,10 @@ alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode,
flags = FWRITE | O_NOFOLLOW | O_CREAT;
error = vn_open_cred(&nd, &flags, cmode, cred, -1);
+ NDFREE(&nd, NDF_ONLY_PNBUF);
if (error)
return (error);
-
- NDFREE(&nd, NDF_ONLY_PNBUF);
+
/* We just unlock so we hold a reference */
VOP_UNLOCK(nd.ni_vp, 0, td);
OpenPOWER on IntegriCloud