Add logic for checking the null
authorjaesick.shin <jaesick.shin@samsung.com>
Thu, 6 Oct 2016 08:47:31 +0000 (17:47 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 11 Oct 2016 01:16:53 +0000 (01:16 +0000)
Add logic about malloc failed.

Change-Id: I8ac6169f65b00200f9d64fa1572217e53c05435f
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12873
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit f114f92cbc6c025fbd92ec99599f79974a43957d)
Reviewed-on: https://gerrit.iotivity.org/gerrit/12981

service/notification/src/provider/NSProviderTopic.c

index 4626fd7def4893a2a9e96f9fd4d5634e813871f3..e398e65acfe1b9179984ac8f67439cc1a3569c55 100644 (file)
@@ -288,6 +288,7 @@ NSResult NSSendTopicList(OCEntityHandlerRequest * entityHandlerRequest)
 \r
         OCRepPayload** payloadTopicArray = (OCRepPayload **) OICMalloc(\r
                 sizeof(OCRepPayload *) * dimensionSize);\r
+        NS_VERIFY_NOT_NULL(payloadTopicArray, NS_ERROR);\r
 \r
         size_t dimensions[3] =\r
         { dimensionSize, 0, 0 };\r