From: jaesick.shin Date: Thu, 13 Oct 2016 01:39:56 +0000 (+0900) Subject: Add logic about checking the NULL and modify warning code. X-Git-Tag: 1.2.0+RC4~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e950ac79e45fbf7b32da7616aa198c7a57c59379;p=platform%2Fupstream%2Fiotivity.git Add logic about checking the NULL and modify warning code. This patch include, check the NULL and modify warning code. Change-Id: Ie28548563357e0c9565ecdcd776cce60d3d42f33 Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/13195 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/notification/cpp-wrapper/examples/linux/notificationserviceconsumer.cpp b/service/notification/cpp-wrapper/examples/linux/notificationserviceconsumer.cpp index e005bcf..1efff70 100755 --- a/service/notification/cpp-wrapper/examples/linux/notificationserviceconsumer.cpp +++ b/service/notification/cpp-wrapper/examples/linux/notificationserviceconsumer.cpp @@ -131,7 +131,7 @@ void *OCProcessThread(void *ptr) int main(void) { - pthread_t OCThread = NULL; + pthread_t OCThread = 0; std::cout << "start Iotivity" << std::endl; diff --git a/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp b/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp index 8b2cd56..374405e 100755 --- a/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp +++ b/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp @@ -82,7 +82,7 @@ void syncCallback(OIC::Service::NSSyncInfo *sync) int main() { int num = 0; - pthread_t processThread = NULL; + pthread_t processThread = 0; std::cout << "start Iotivity" << std::endl; diff --git a/service/notification/src/provider/NSProviderSubscription.c b/service/notification/src/provider/NSProviderSubscription.c index 1c0d70b..f526a46 100644 --- a/service/notification/src/provider/NSProviderSubscription.c +++ b/service/notification/src/provider/NSProviderSubscription.c @@ -135,7 +135,9 @@ void NSHandleSubscription(OCEntityHandlerRequest *entityHandlerRequest, NSResour { NS_LOG(DEBUG, "resourceType == NS_RESOURCE_MESSAGE"); NSCacheElement * element = (NSCacheElement *) OICMalloc(sizeof(NSCacheElement)); + NS_VERIFY_NOT_NULL_V(element); NSCacheSubData * subData = (NSCacheSubData *) OICMalloc(sizeof(NSCacheSubData)); + NS_VERIFY_NOT_NULL_V(subData); OICStrcpy(subData->id, UUID_STRING_SIZE, id); NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id); @@ -192,7 +194,9 @@ void NSHandleSubscription(OCEntityHandlerRequest *entityHandlerRequest, NSResour { NS_LOG(DEBUG, "resourceType == NS_RESOURCE_SYNC"); NSCacheElement * element = (NSCacheElement *) OICMalloc(sizeof(NSCacheElement)); + NS_VERIFY_NOT_NULL_V(element); NSCacheSubData * subData = (NSCacheSubData *) OICMalloc(sizeof(NSCacheSubData)); + NS_VERIFY_NOT_NULL_V(subData); OICStrcpy(subData->id, UUID_STRING_SIZE, id); NS_LOG_V(DEBUG, "SubList ID = [%s]", subData->id);