Resolved svace issues
authoramar <amar.sri@samsung.com>
Wed, 1 Feb 2017 08:49:18 +0000 (14:19 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 8 Mar 2017 09:19:55 +0000 (09:19 +0000)
Change-Id: Id3aa9a857756a0cda216a12dbef42d9e326998c2
Signed-off-by: amar srivastava <amar.sri@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17041
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 2046a5e2643b54a29ee39ce67677b7d574baa832)
Reviewed-on: https://gerrit.iotivity.org/gerrit/17259
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/dpairingresource.c
resource/csdk/security/src/pstatresource.c

index 3cd5619..5832b57 100644 (file)
@@ -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);
index 613941e..631fa63 100644 (file)
@@ -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;
index d929dce..2dfc275 100644 (file)
@@ -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;