Commit 0441d74e authored by Parkhi's avatar Parkhi Committed by Uze Choi

Fix defects detected by static analysis

Change-Id: I9f2fd3a24df5f1394174e71ee561ed02ac8d0769
Signed-off-by: default avatarParkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15133Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarJihun Ha <jihun.ha@samsung.com>
(cherry picked from commit 94ad6508)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15135Reviewed-by: default avatarHemant Mahsky <h.mahsky@samsung.com>
parent 4dd58a8e
......@@ -549,7 +549,7 @@ OCRepPayload* constructResponseOfWiFi(char *interface)
else
{
OCRepPayloadAddInterface(payload, OC_RSRVD_INTERFACE_DEFAULT);
OCRepPayloadAddResourceType(payload, OC_RSRVD_ES_RES_TYPE_WIFI);
OCRepPayloadAddResourceType(payload, OC_RSRVD_ES_RES_TYPE_WIFI);
}
size_t dimensions[MAX_REP_ARRAY_DEPTH] = {gWiFiResource.numMode, 0, 0};
......@@ -945,6 +945,11 @@ OCRepPayload* constructResponseOfProv(OCEntityHandlerRequest *ehRequest)
size_t interfacesDimensions[MAX_REP_ARRAY_DEPTH] = {3, 0, 0};
char **interfaces = (char **)OICMalloc(3 * sizeof(char*));
if(!interfaces)
{
OIC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
return NULL;
}
interfaces[0] = OICStrdup(OC_RSRVD_INTERFACE_DEFAULT);
interfaces[1] = OICStrdup(OC_RSRVD_INTERFACE_LL);
......@@ -954,6 +959,11 @@ OCRepPayload* constructResponseOfProv(OCEntityHandlerRequest *ehRequest)
size_t resourceTypesDimensions[MAX_REP_ARRAY_DEPTH] = {2, 0, 0};
char **resourceTypes = (char **)OICMalloc(2 * sizeof(char*));
if(!resourceTypes)
{
OIC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
return NULL;
}
resourceTypes[0] = OICStrdup(OC_RSRVD_ES_RES_TYPE_PROV);
resourceTypes[1] = OICStrdup(OC_RSRVD_ES_RES_TYPE_COL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment