wsman-soap: check return value of mutex methods
Fail caller if pthread_mutex_* functions are failed.
@@ -198,14 +198,22 @@ search_pull_subs_info(SoapH soap, WsXmlDocH indoc)
uuid = ws_xml_get_node_text(node);
}
if(uuid == NULL) return subsInfo;
- pthread_mutex_lock(&soap->lockSubs);
+ if (pthread_mutex_lock(&soap->lockSubs))
+ {
+ error("Error: Can't lock soap->lockSubs");
+ return NULL;
+ }
lnode = list_first(soapCntx->subscriptionMemList);
while(lnode) {
subsInfo = (WsSubscribeInfo *)lnode->list_data;
if(!strcmp(subsInfo->subsId, uuid+5)) break;
lnode = list_next(soapCntx->subscriptionMemList, lnode);
}
- pthread_mutex_unlock(&soap->lockSubs);
+ if (pthread_mutex_unlock(&soap->lockSubs))
+ {
+ error("Error: Can't unlock soap->lockSubs");
+ return NULL;
+ }
if(lnode == NULL) return NULL;
return subsInfo;
}
