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:
parent
3ff9006c71
commit
9935282d50
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84724
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user