[IOT-1405, IOT-1418] Bug fixes
authorAshwini Kumar <k.ashwini@samsung.com>
Fri, 7 Oct 2016 13:15:52 +0000 (18:45 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 10 Oct 2016 04:53:12 +0000 (04:53 +0000)
Memory leak issue in Secure resources
scan newline '\n' at end of line

Change-Id: I8e7675fef88670ea6f4fc7c38a1b484cc6e28b50
Signed-off-by: Ashwini Kumar <k.ashwini@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12951
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/aclresource.c
resource/csdk/security/src/amsmgr.c
resource/csdk/security/src/psinterface.c
resource/provisioning/examples/cloudClient.cpp

index e887a3e..a8485af 100644 (file)
@@ -2096,6 +2096,7 @@ OCStackResult InitACLResource()
     {
         // Read ACL resource from PS
         gAcl = CBORPayloadToAcl(data, size);
+        OICFree(data);
     }
     /*
      * If SVR database in persistent storage got corrupted or
index e348969..90f8484 100644 (file)
@@ -122,7 +122,7 @@ static OCStackApplicationResult AmsMgrDiscoveryCallback(void *ctx, OCDoHandle ha
 
     OicUuid_t deviceId = {.id={0}};
     memcpy(&deviceId, &doxm->deviceID, sizeof(deviceId));
-    OICFree(doxm);
+    DeleteDoxmBinData(doxm);
 
     /* TODO : By assuming that the first response received is the actual
      * AMS service, a 'bad device' can cause DoS attack.
index bb5fab1..a7f87a9 100644 (file)
@@ -654,7 +654,7 @@ OCStackResult CreateResetProfile(void)
             memcpy(&pstat->rownerID, &emptyUuid, sizeof(OicUuid_t));
 
             ret = PstatToCBORPayload(pstat, &pstatCbor, &pstatCborLen, false);
-            OICFree(pstat);
+            DeletePstatBinData(pstat);
         }
         if (doxmCbor)
         {
@@ -669,7 +669,7 @@ OCStackResult CreateResetProfile(void)
             memcpy(&doxm->rownerID, &emptyUuid, sizeof(OicUuid_t));
 
             ret = DoxmToCBORPayload(doxm, &doxmCbor, &doxmCborLen, false);
-            OICFree(doxm);
+            DeleteDoxmBinData(doxm);
         }
 
         {
index cec9b2e..317539a 100644 (file)
@@ -289,6 +289,7 @@ static void userRequests(void *data)
 
         int request = 0;
         scanf("%d", &request);
+        getchar();
 
         switch (request)
         {