From: Iurii Metelytsia Date: Thu, 5 Sep 2019 17:31:27 +0000 (+0300) Subject: Some svace issues fixed X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F214007%2F1;p=platform%2Fupstream%2Fiotivity.git 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 --- 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;