Use crhold() instead of crdup(). The md(4) driver doesn't modify the ucred

that it uses, so it merely needs to bump its refcount to make it immutable
rather than obtain its own copy.
This commit is contained in:
John Baldwin 2001-10-09 16:37:51 +00:00
parent 3ff9006c71
commit 9935282d50

View File

@ -612,7 +612,8 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
if (sc->cred)
crfree(sc->cred);
sc->cred = crdup(cred);
crhold(cred);
sc->cred = cred;
/*
* Horrible kludge to establish credentials for NFS XXX.