Mercurial > hg > freeDiameter-proposed
diff libfdcore/p_psm.c @ 1567:745a10fa6e32
fd_psm_start: do not exit function in error case without mutex unlock
Coverity CID 349344
author | Thomas Klausner <wiz@gatalith.at> |
---|---|
date | Tue, 22 Jun 2021 21:40:05 +0200 |
parents | 566bb46cc73f |
children |
line wrap: on
line diff
--- a/libfdcore/p_psm.c Tue Jun 22 21:34:30 2021 +0200 +++ b/libfdcore/p_psm.c Tue Jun 22 21:40:05 2021 +0200 @@ -141,12 +141,13 @@ /* Allow the state machines to start */ int fd_psm_start() { + int ret = 0; TRACE_ENTRY(""); CHECK_POSIX( pthread_mutex_lock(&started_mtx) ); started = 1; - CHECK_POSIX( pthread_cond_broadcast(&started_cnd) ); + ret = pthread_cond_broadcast(&started_cnd); CHECK_POSIX( pthread_mutex_unlock(&started_mtx) ); - return 0; + return ret; }