Commit e967aab9 authored by ol.beketov's avatar ol.beketov Committed by Randeep

[IOT-2113] Change the logic not to delete double time

Change-Id: I56923e53e9b81da45b9ff9e50e7df9cdde233c25
Signed-off-by: default avatarol.beketov <ol.beketov@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19631Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
parent 2eca3ad4
...@@ -624,7 +624,6 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message) ...@@ -624,7 +624,6 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message)
{ {
NS_LOGE ("Failed to create OcRepresentation"); NS_LOGE ("Failed to create OcRepresentation");
delete ocRepresentation; delete ocRepresentation;
return NULL;
} }
else else
{ {
...@@ -635,7 +634,10 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message) ...@@ -635,7 +634,10 @@ jobject getJavaMessage(JNIEnv *env, OIC::Service::NSMessage message)
if (!fid_extraInfo) if (!fid_extraInfo)
{ {
NS_LOGE ("Failed to get mExtraInfo for Message"); NS_LOGE ("Failed to get mExtraInfo for Message");
delete ocRepresentation; if (ocRepresentation)
{
delete ocRepresentation;
}
return NULL; return NULL;
} }
NS_LOGD ("setting extraInfo field"); NS_LOGD ("setting extraInfo field");
......
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