Commit d0184767 authored by ol.beketov's avatar ol.beketov Committed by Randeep

[IOT-2092] Check null pointer before dereference

Change-Id: Ib8032c41e8910087be5c5b30fee9a7b4a3992f01
Signed-off-by: default avatarol.beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19623Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: default avatarAndrii Shtompel <a.shtompel@samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
parent 3066f7be
......@@ -475,11 +475,10 @@ TWResultCode TWRetrieveEUI(PIPlugin_Zigbee * plugin, TWSock * twSock)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment