svace fixes
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / adapter_util / ca_adapter_net_ssl.c
index 966b2a4..ce4765a 100644 (file)
@@ -928,6 +928,10 @@ static int ParseChain(mbedtls_x509_crt * crt, unsigned char * buf, size_t bufLen
             else
             {
                 unsigned char * lastCert = (unsigned char *)OICMalloc((len + 1) * sizeof(unsigned char));
+                if (lastCert == NULL)
+                {
+                    goto exit;
+                }
                 memcpy(lastCert, buf + pos, len);
                 lastCert[len] = 0x00;
                 ret = mbedtls_x509_crt_parse(crt, lastCert, len + 1);