Don't forget to call NDFREE(9) in case of vn_open_cred() failure.
MFC after: 3 days
This commit is contained in:
parent
ac52c99fe4
commit
bc66ded70e
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user