From e967aab904707d882257dd0674cb5232dec44cdc Mon Sep 17 00:00:00 2001
From: "ol.beketov"
Date: Thu, 4 May 2017 16:59:56 +0300
Subject: [PATCH] [IOT-2113] Change the logic not to delete double time
Change-Id: I56923e53e9b81da45b9ff9e50e7df9cdde233c25
Signed-off-by: ol.beketov
Reviewed-on: https://gerrit.iotivity.org/gerrit/19631
Tested-by: jenkins-iotivity
Reviewed-by: Uze Choi
Reviewed-by: Randeep Singh
---
.../src/main/jni/consumer/JniNotificationConsumer.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/service/notification/android/notification-service/src/main/jni/consumer/JniNotificationConsumer.cpp b/service/notification/android/notification-service/src/main/jni/consumer/JniNotificationConsumer.cpp
index 5ec78e9..0d16c3d 100644
--- a/service/notification/android/notification-service/src/main/jni/consumer/JniNotificationConsumer.cpp
+++ b/service/notification/android/notification-service/src/main/jni/consumer/JniNotificationConsumer.cpp
@@ -624,7 +624,6 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message)
{
NS_LOGE ("Failed to create OcRepresentation");
delete ocRepresentation;
- return NULL;
}
else
{
@@ -635,7 +634,10 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message)
if (!fid_extraInfo)
{
NS_LOGE ("Failed to get mExtraInfo for Message");
- delete ocRepresentation;
+ if (ocRepresentation)
+ {
+ delete ocRepresentation;
+ }
return NULL;
}
NS_LOGD ("setting extraInfo field");
--
2.7.4