From 6883cb817952aacd5d76faaee9a382c23462efda Mon Sep 17 00:00:00 2001 From: amar Date: Wed, 1 Feb 2017 14:19:18 +0530 Subject: [PATCH] Resolved svace issues Change-Id: Id3aa9a857756a0cda216a12dbef42d9e326998c2 Signed-off-by: amar srivastava Reviewed-on: https://gerrit.iotivity.org/gerrit/17041 Tested-by: jenkins-iotivity Reviewed-by: Randeep Singh (cherry picked from commit 2046a5e2643b54a29ee39ce67677b7d574baa832) Reviewed-on: https://gerrit.iotivity.org/gerrit/17259 Reviewed-by: Phil Coval --- resource/csdk/security/src/doxmresource.c | 1 + resource/csdk/security/src/dpairingresource.c | 1 + resource/csdk/security/src/pstatresource.c | 1 + 3 files changed, 3 insertions(+) diff --git a/resource/csdk/security/src/doxmresource.c b/resource/csdk/security/src/doxmresource.c index 3cd5619..5832b57 100644 --- a/resource/csdk/security/src/doxmresource.c +++ b/resource/csdk/security/src/doxmresource.c @@ -363,6 +363,7 @@ exit: OIC_LOG(DEBUG, TAG, "Memory getting reallocated."); // reallocate and try again! OICFree(outPayload); + outPayload = NULL; // Since the allocated initial memory failed, double the memory. cborLen += cbor_encoder_get_buffer_size(&encoder, encoder.end); OIC_LOG_V(DEBUG, TAG, "Doxm reallocation size : %zd.", cborLen); diff --git a/resource/csdk/security/src/dpairingresource.c b/resource/csdk/security/src/dpairingresource.c index 613941e..631fa63 100644 --- a/resource/csdk/security/src/dpairingresource.c +++ b/resource/csdk/security/src/dpairingresource.c @@ -257,6 +257,7 @@ exit: { // reallocate and try again! OICFree(outPayload); + outPayload = NULL; // Since the allocated initial memory failed, double the memory. cborLen += cbor_encoder_get_buffer_size(&encoder, encoder.end); cborEncoderResult = CborNoError; diff --git a/resource/csdk/security/src/pstatresource.c b/resource/csdk/security/src/pstatresource.c index d929dce..2dfc275 100644 --- a/resource/csdk/security/src/pstatresource.c +++ b/resource/csdk/security/src/pstatresource.c @@ -223,6 +223,7 @@ exit: { // reallocate and try again! OICFree(outPayload); + outPayload = NULL; // Since the allocated initial memory failed, double the memory. cborLen += cbor_encoder_get_buffer_size(&encoder, encoder.end); cborEncoderResult = CborNoError; -- 2.7.4