Handled failure to release a mutex lock. Coverity CID 28698.

This commit is contained in:
Thomas Schmitt 2015-11-13 20:22:51 +00:00
parent 1103a7127e
commit 6f1e97a8e3
2 changed files with 7 additions and 4 deletions

View File

@ -2394,7 +2394,7 @@ struct xorriso_md5_state {
int Xorriso__add_spot(struct xorriso_md5_state *state, int Xorriso__add_spot(struct xorriso_md5_state *state,
int start_lba, int blocks, int quality, int flag) int start_lba, int blocks, int quality, int flag)
{ {
int ret; int ret, uret;
if(state->chunk != NULL) { if(state->chunk != NULL) {
ret= pthread_mutex_lock(&(state->spot_mutex)); ret= pthread_mutex_lock(&(state->spot_mutex));
@ -2402,8 +2402,11 @@ int Xorriso__add_spot(struct xorriso_md5_state *state,
return(0); return(0);
} }
ret= Spotlist_add_item(state->spotlist, start_lba, blocks, quality, 0); ret= Spotlist_add_item(state->spotlist, start_lba, blocks, quality, 0);
if(state->chunk != NULL) if(state->chunk != NULL) {
pthread_mutex_unlock(&(state->spot_mutex)); uret= pthread_mutex_unlock(&(state->spot_mutex));
if(uret != 0 && ret > 0)
ret= 0;
}
return(ret); return(ret);
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.13.152751" #define Xorriso_timestamP "2015.11.13.202241"