[IOT-1810]Fix for Double free of payload in C for Notification Message
authorabitha.s <abitha.s@samsung.com>
Thu, 9 Feb 2017 11:08:59 +0000 (16:38 +0530)
committerUze Choi <uzchoi@samsung.com>
Fri, 10 Feb 2017 01:23:56 +0000 (01:23 +0000)
Change-Id: I8f1ddb3208e6383e4e4154c78b03838aa579c902
Signed-off-by: abitha.s <abitha.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17149
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/src/provider/NSProviderNotification.c

index 7f33a8b..d27c3be 100644 (file)
@@ -136,6 +136,7 @@ NSResult NSSendNotification(NSMessage *msg)
     {
         NS_LOG(ERROR, "SubList->head is NULL, empty SubList");
         OCRepPayloadDestroy(payload);
+        msg->extraInfo = NULL;
         return NS_ERROR;
     }
 
@@ -203,6 +204,7 @@ NSResult NSSendNotification(NSMessage *msg)
     {
         NS_LOG(ERROR, "observer count is zero");
         OCRepPayloadDestroy(payload);
+        msg->extraInfo = NULL;
         return NS_ERROR;
     }