Commit 82012af3 authored by Alex Kelley's avatar Alex Kelley Committed by Kevin Kane

IOT-1811 Move MOT device info cleanup to fix AV

Change-Id: Ia7ce7aca7224da855776b47a46749c0baed18b39
Signed-off-by: default avatarAlex Kelley <alexke@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17163Reviewed-by: default avatarPawel Winogrodzki <pawelwi@microsoft.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
parent c4f64d5e
......@@ -113,6 +113,7 @@ static OCStackApplicationResult MOTUpdateSecurityResourceCB(void *ctx, OCDoHandl
exit:
if(motCtx)
{
PMDeleteDeviceList(motCtx->selectedDeviceInfo);
OICFree(motCtx->ctxResultArray);
OICFree(motCtx);
}
......@@ -187,15 +188,11 @@ exit:
//If POST request successfully sent, motCtx will be cleaned from response handler.
if(freeFlag && motCtx)
{
PMDeleteDeviceList(motCtx->selectedDeviceInfo);
OICFree(motCtx->ctxResultArray);
OICFree(motCtx);
}
if (localTargetDeviceInfo)
{
PMDeleteDeviceList(localTargetDeviceInfo);
}
return postMomRes;
}
......@@ -467,20 +464,17 @@ exit:
//If POST request successfully sent, motCtx will be cleaned from response handler.
if(freeFlag && motCtx)
{
PMDeleteDeviceList(motCtx->selectedDeviceInfo);
OICFree(motCtx->ctxResultArray);
OICFree(motCtx);
}
if(pinCred)
{
OICFree(pinCred->privateData.data);
OICFree(pinCred);
}
if (localTargetDeviceInfo)
{
PMDeleteDeviceList(localTargetDeviceInfo);
}
return postCredRes;
}
......
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