summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 3ddd286..8f85803 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1765,6 +1765,19 @@ crdup(struct ucred *cr)
return (newcr);
}
+#ifdef DIAGNOSTIC
+void
+cred_free_thread(struct thread *td)
+{
+ struct ucred *cred;
+
+ cred = td->td_ucred;
+ td->td_ucred = NULL;
+ if (cred != NULL)
+ crfree(cred);
+}
+#endif
+
/*
* Fill in a struct xucred based on a struct ucred.
*/
OpenPOWER on IntegriCloud