From: jake Date: Thu, 2 Mar 2017 05:11:49 +0000 (+0900) Subject: Fix warning from static analyzer X-Git-Tag: 1.3.0~555 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91681b44e266ad9753e9dcd6508355f169f90904;p=platform%2Fupstream%2Fiotivity.git Fix warning from static analyzer - Remove unnecessary function (isdigit) * it is valid function when the param is char but used int param - Add memory free when return error. Change-Id: I1bbecc7e88f8973340299b8393736e6fd24f1587 Signed-off-by: jake Reviewed-on: https://gerrit.iotivity.org/gerrit/17609 Reviewed-by: Chihyun Cho Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/notification/examples/linux/notificationprovider.c b/service/notification/examples/linux/notificationprovider.c index 534973a..f312e12 100644 --- a/service/notification/examples/linux/notificationprovider.c +++ b/service/notification/examples/linux/notificationprovider.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "NSProviderInterface.h" #include "NSCommon.h" @@ -206,7 +205,7 @@ int main() printf("input : "); - if(scanf("%d", &num) > 0 && isdigit(num) == 0) + if(scanf("%d", &num) > 0) { if(scanf("%c", &dummy) > 0) { diff --git a/service/notification/src/consumer/NSConsumerMemoryCache.c b/service/notification/src/consumer/NSConsumerMemoryCache.c index a5a63e5..66a5547 100644 --- a/service/notification/src/consumer/NSConsumerMemoryCache.c +++ b/service/notification/src/consumer/NSConsumerMemoryCache.c @@ -248,6 +248,7 @@ NSResult NSConsumerCacheWriteProvider(NSCacheList * list, NSCacheElement * newOb if (!obj->data) { NS_LOG (ERROR, "Failed to CopyProvider"); + NSOICFree(obj); pthread_mutex_unlock(mutex); return NS_ERROR;