From: Alex Kelley Date: Thu, 9 Feb 2017 02:16:46 +0000 (-0800) Subject: IOT-1811 Move MOT device info cleanup to fix AV X-Git-Tag: 1.3.0~657 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82012af32c710c5c224bdfef93be1796d191a2e5;p=platform%2Fupstream%2Fiotivity.git IOT-1811 Move MOT device info cleanup to fix AV Change-Id: Ia7ce7aca7224da855776b47a46749c0baed18b39 Signed-off-by: Alex Kelley Reviewed-on: https://gerrit.iotivity.org/gerrit/17163 Reviewed-by: Pawel Winogrodzki Tested-by: jenkins-iotivity Reviewed-by: Kevin Kane --- diff --git a/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c b/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c index 20dcfad..4e7757d 100644 --- a/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c +++ b/resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c @@ -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; }