From e0516fbe69c4db9134434500dc51fe3d699aa0da Mon Sep 17 00:00:00 2001 From: Iurii Metelytsia Date: Thu, 5 Sep 2019 20:31:27 +0300 Subject: [PATCH] Some svace issues fixed https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/215d4911bf4858bba1c8a5719cbe8516df6e7158 (cherry-picked from 215d4911bf4858bba1c8a5719cbe8516df6e7158) Change-Id: I2e32b5b381de1c063dff9ef924a690e1113b2478 Signed-off-by: Iurii Metelytsia Signed-off-by: Sudipto --- resource/csdk/security/provisioning/src/cloud/aclgroup.c | 2 ++ resource/csdk/security/provisioning/src/cloud/aclinvite.c | 1 + resource/csdk/security/provisioning/src/cloud/csr.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/resource/csdk/security/provisioning/src/cloud/aclgroup.c b/resource/csdk/security/provisioning/src/cloud/aclgroup.c index f15e0af..01111b9 100644 --- a/resource/csdk/security/provisioning/src/cloud/aclgroup.c +++ b/resource/csdk/security/provisioning/src/cloud/aclgroup.c @@ -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; } diff --git a/resource/csdk/security/provisioning/src/cloud/aclinvite.c b/resource/csdk/security/provisioning/src/cloud/aclinvite.c index 78d1097..31eb586 100644 --- a/resource/csdk/security/provisioning/src/cloud/aclinvite.c +++ b/resource/csdk/security/provisioning/src/cloud/aclinvite.c @@ -218,6 +218,7 @@ OCStackResult OCCloudAclInviteUser(void* ctx, OCRepPayload *payload = OCRepPayloadCreate(); if (!payload) { + OICFree(cbData.context); return OC_STACK_NO_MEMORY; } diff --git a/resource/csdk/security/provisioning/src/cloud/csr.c b/resource/csdk/security/provisioning/src/cloud/csr.c index 048e0f5..3cb44fc 100644 --- a/resource/csdk/security/provisioning/src/cloud/csr.c +++ b/resource/csdk/security/provisioning/src/cloud/csr.c @@ -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; -- 2.7.4