From: jaesick.shin Date: Mon, 1 Aug 2016 02:28:04 +0000 (+0900) Subject: bug fixes for check null in NSProviderMemoryCache. X-Git-Tag: 1.2.0+RC1~52^2~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf80455a7426c16d1f899909d5ff2b3291427526;p=platform%2Fupstream%2Fiotivity.git bug fixes for check null in NSProviderMemoryCache. Added check null about list and list->head. Change-Id: Ie1df2395a14d20a012383d7f5865e96fc2405b91 Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/9877 Tested-by: jenkins-iotivity Reviewed-by: Hun-je Yeon Reviewed-by: Madan Lanka --- diff --git a/service/notification/src/provider/cache/linux/NSProviderMemoryCache.c b/service/notification/src/provider/cache/linux/NSProviderMemoryCache.c index 305bd8f..8be56ba 100755 --- a/service/notification/src/provider/cache/linux/NSProviderMemoryCache.c +++ b/service/notification/src/provider/cache/linux/NSProviderMemoryCache.c @@ -295,6 +295,12 @@ bool NSIsSameObId(NSCacheSubData * data, OCObservationId id) NSResult NSProviderDeleteSubDataFromObId(NSCacheList * list, OCObservationId id) { + if(!list || !list->head) + { + NS_LOG(INFO, "list is NULL"); + return NS_FAIL; + } + pthread_mutex_lock(&NSCacheMutex); NSCacheElement * prev = list->head; NSCacheElement * del = list->head;