mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Decrease reference count if we won't use the thread, this avoids memory
leak under some cases.
This commit is contained in:
parent
f742a1edcd
commit
39454d368f
2 changed files with 8 additions and 0 deletions
|
|
@ -705,6 +705,10 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
|||
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
|
||||
if (kmbx != NULL)
|
||||
kse_wakeup(kmbx);
|
||||
if (suspended_thread != NULL)
|
||||
_thr_ref_delete(NULL, suspended_thread);
|
||||
if (signaled_thread != NULL)
|
||||
_thr_ref_delete(NULL, signaled_thread);
|
||||
return (NULL);
|
||||
} else if (!SIGISMEMBER(pthread->sigmask, sig)) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -705,6 +705,10 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
|||
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
|
||||
if (kmbx != NULL)
|
||||
kse_wakeup(kmbx);
|
||||
if (suspended_thread != NULL)
|
||||
_thr_ref_delete(NULL, suspended_thread);
|
||||
if (signaled_thread != NULL)
|
||||
_thr_ref_delete(NULL, signaled_thread);
|
||||
return (NULL);
|
||||
} else if (!SIGISMEMBER(pthread->sigmask, sig)) {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue