diff options
author | julian <julian@FreeBSD.org> | 2005-03-21 22:55:38 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2005-03-21 22:55:38 +0000 |
commit | 1a64e1bde49f597e6ff0d734ef227a1d76094511 (patch) | |
tree | 14b2a321173bba5c248d62a76a66a235930d4ca3 | |
parent | 78bbe1ac6e9922a54f2be530b1183b50d4dde8ac (diff) | |
download | FreeBSD-src-1a64e1bde49f597e6ff0d734ef227a1d76094511.zip FreeBSD-src-1a64e1bde49f597e6ff0d734ef227a1d76094511.tar.gz |
Fix code freeing wrong cred pointer.
Submitted by: das
Noticed by: Coverity tool
MFC after: 3 days
Note: usually the two pointers point to the same
thing but it was still a bug.
-rw-r--r-- | sys/kern/kern_thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 1b26e8f..dd8f80c 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -592,8 +592,10 @@ thread_wait(struct proc *p) KASSERT((p->p_numksegrps == 1), ("Multiple ksegrps in wait1()")); FOREACH_THREAD_IN_PROC(p, td) { if (td->td_standin != NULL) { - crfree(td->td_ucred); - td->td_ucred = NULL; + if (td->td_standin->td_ucred != NULL) { + crfree(td->td_standin->td_ucred); + td->td_standin->td_ucred = NULL; + } thread_free(td->td_standin); td->td_standin = NULL; } |