Change-Id: Ib8032c41e8910087be5c5b30fee9a7b4a3992f01
Signed-off-by: ol.beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19623
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
entry = readEntry(twSock->fd);
if(!entry)
{
- result = TWReleaseMutex(&twSock->mutex);
- if(result != TW_RESULT_OK)
- {
- goto exit;
- }
+ TWReleaseMutex(&twSock->mutex);
+ // in case entry is NULL, further processing will cause crash or UB
+ result = TW_RESULT_ERROR;
+ goto exit;
}
twSock->eui = (char *) OICMalloc(strlen(entry->lines[0].line)+1);
if(!twSock->eui)