@@ -3705,7 +3705,7 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
37053705 if (pthread_mutex_init (& cond -> mutex , NULL ) != 0 )
37063706 return MEMORY_E ;
37073707 if (pthread_cond_init (& cond -> cond , NULL ) != 0 ) {
3708- pthread_mutex_destroy (& cond -> mutex );
3708+ ( void ) pthread_mutex_destroy (& cond -> mutex );
37093709 return MEMORY_E ;
37103710 }
37113711 return 0 ;
@@ -3716,8 +3716,8 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
37163716 if (cond == NULL )
37173717 return BAD_FUNC_ARG ;
37183718
3719- pthread_mutex_destroy (& cond -> mutex );
3720- pthread_cond_destroy (& cond -> cond );
3719+ ( void ) pthread_mutex_destroy (& cond -> mutex );
3720+ ( void ) pthread_cond_destroy (& cond -> cond );
37213721 return 0 ;
37223722 }
37233723
@@ -3726,21 +3726,25 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
37263726 if (cond == NULL )
37273727 return BAD_FUNC_ARG ;
37283728
3729- pthread_mutex_lock (& cond -> mutex );
3730- pthread_cond_signal (& cond -> cond );
3731- pthread_mutex_unlock (& cond -> mutex );
3732- return 0 ;
3729+ if (pthread_mutex_lock (& cond -> mutex ) == 0 ) {
3730+ (void )pthread_cond_signal (& cond -> cond );
3731+ (void )pthread_mutex_unlock (& cond -> mutex );
3732+ return 0 ;
3733+ }
3734+ return BAD_MUTEX_E ;
37333735 }
37343736
37353737 int wolfSSL_CondWait (COND_TYPE * cond )
37363738 {
37373739 if (cond == NULL )
37383740 return BAD_FUNC_ARG ;
37393741
3740- pthread_mutex_lock (& cond -> mutex );
3741- pthread_cond_wait (& cond -> cond , & cond -> mutex );
3742- pthread_mutex_unlock (& cond -> mutex );
3743- return 0 ;
3742+ if (pthread_mutex_lock (& cond -> mutex ) == 0 ) {
3743+ (void )pthread_cond_wait (& cond -> cond , & cond -> mutex );
3744+ (void )pthread_mutex_unlock (& cond -> mutex );
3745+ return 0 ;
3746+ }
3747+ return BAD_MUTEX_E ;
37443748 }
37453749 #else
37463750 /* Apple style dispatch semaphore */
0 commit comments