Commit ff2eebfa authored by Jihun Ha's avatar Jihun Ha Committed by Uze Choi

Fix defects detected by static analysis

1. nativeRemoteEnrollee and jRemoteEnrollee are initialized with NULL.
2. NULL is returned if global lister for event lister fails to create.

Change-Id: I9b77acb439f4f42e5c382370d060d525e5d6e652
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16939Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent f6bbfc6c
......@@ -40,8 +40,8 @@ Java_org_iotivity_service_easysetup_mediator_EasySetup_nativeCreateRemoteEnrolle
{
ES_LOGI("JniEasySetup::nativeCreateRemoteEnrollee enter");
std::shared_ptr<RemoteEnrollee> nativeRemoteEnrollee;
jobject jRemoteEnrollee;
std::shared_ptr<RemoteEnrollee> nativeRemoteEnrollee = NULL;
jobject jRemoteEnrollee = NULL;
if(!jResource)
{
......
......@@ -74,13 +74,14 @@ class JniEsListenerManager
m_listenerMap.insert(
std::pair < jobject,
std::pair<T *, int >> (jgListener, std::pair<T *, int>(onEventListener, 1)));
ES_LOGD("OnEventListener: new listener");
}
else
{
ES_LOGD("OnEventListener: Failed to create global listener ref.");
delete onEventListener;
onEventListener = NULL;
}
ES_LOGD("OnEventListener: new listener");
}
m_mapMutex.unlock();
return onEventListener;
......
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