Some svace issues fixed 07/214007/1
authorIurii Metelytsia <i.metelytsia@samsung.com>
Thu, 5 Sep 2019 17:31:27 +0000 (20:31 +0300)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 17 Sep 2019 07:22:39 +0000 (16:22 +0900)
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/215d4911bf4858bba1c8a5719cbe8516df6e7158
(cherry-picked from 215d4911bf4858bba1c8a5719cbe8516df6e7158)

Change-Id: I2e32b5b381de1c063dff9ef924a690e1113b2478
Signed-off-by: Iurii Metelytsia <i.metelytsia@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/security/provisioning/src/cloud/aclgroup.c
resource/csdk/security/provisioning/src/cloud/aclinvite.c
resource/csdk/security/provisioning/src/cloud/csr.c

index f15e0af8a18b6f5475148aa77e916922ad249e70..01111b9ace386c515d92b38903a7c77359d9de16 100644 (file)
@@ -121,6 +121,7 @@ OCStackResult OCCloudAclCreateGroup(void* ctx,
     OCRepPayload *payload = OCRepPayloadCreate();
     if (!payload)
     {
+        OICFree(cbData.context);
         return OC_STACK_NO_MEMORY;
     }
 
@@ -249,6 +250,7 @@ OCStackResult OCCloudAclShareDeviceIntoGroup(void* ctx,
     OCRepPayload *payload = OCRepPayloadCreate();
     if (!payload)
     {
+        OICFree(cbData.context);
         return OC_STACK_NO_MEMORY;
     }
 
index 78d1097bc264002ce7e62215a5d5c5a5fd067044..31eb58606dcf8793b5a74e7897837383b261a1b2 100644 (file)
@@ -218,6 +218,7 @@ OCStackResult OCCloudAclInviteUser(void* ctx,
     OCRepPayload *payload = OCRepPayloadCreate();
     if (!payload)
     {
+        OICFree(cbData.context);
         return OC_STACK_NO_MEMORY;
     }
 
index 048e0f53d332fbb7375ff2c2be2e9d332e0b8a1f..3cb44fcd92dba8a0c175971aece4446cfa8aaf4b 100644 (file)
@@ -214,6 +214,7 @@ static int GenerateCSR(char *subject, OCByteString *csr)
     {
         OIC_LOG(ERROR, TAG, "ecdsaGenKeypair error");
         OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+        OICFree(key);
         return -1;
     }
 
@@ -278,6 +279,7 @@ static int GenerateCSR(char *subject, OCByteString *csr)
     {
         OIC_LOG(ERROR, TAG, "mbedtls_x509write_csr_der error");
         OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+        OICFree(buf);
         return -1;
     }
 
@@ -419,6 +421,8 @@ static OCStackResult HandleCertificateIssueRequest(void *ctx, void **data, OCCli
         }
     }
 
+    OICFree(deviceId);
+
     OICClearMemory(g_privateKey.bytes, g_privateKey.len);
     OICFree(g_privateKey.bytes);
     g_privateKey.bytes = NULL;