From 82012af32c710c5c224bdfef93be1796d191a2e5 Mon Sep 17 00:00:00 2001 From: Alex Kelley Date: Wed, 8 Feb 2017 18:16:46 -0800 Subject: [PATCH] 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 --- .../provisioning/src/multipleownershiptransfermanager.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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; } -- 2.7.4