(double free) crash occurred when discovering device
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / src / pmutility.c
index 56bf9b2..47f1c3f 100644 (file)
@@ -943,18 +943,18 @@ void PMPrintOCProvisionDev(const OCProvisionDev_t* pDev)
     }
 }
 
-bool PMDeleteFromUUIDList(OCUuidList_t *pUuidList, OicUuid_t *targetId)
+bool PMDeleteFromUUIDList(OCUuidList_t **pUuidList, OicUuid_t *targetId)
 {
-    if(pUuidList == NULL || targetId == NULL)
+    if(*pUuidList == NULL || targetId == NULL)
     {
         return false;
     }
     OCUuidList_t *tmp1 = NULL,*tmp2=NULL;
-    LL_FOREACH_SAFE(pUuidList, tmp1, tmp2)
+    LL_FOREACH_SAFE(*pUuidList, tmp1, tmp2)
     {
         if(0 == memcmp(tmp1->dev.id, targetId->id, sizeof(targetId->id)))
         {
-            LL_DELETE(pUuidList, tmp1);
+            LL_DELETE(*pUuidList, tmp1);
             OICFree(tmp1);
             return true;
         }