bug fixes for deallocate memory logic of "NotificationMessage".
authorjaesick.shin <jaesick.shin@samsung.com>
Wed, 10 Aug 2016 01:13:50 +0000 (10:13 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Wed, 10 Aug 2016 08:37:07 +0000 (08:37 +0000)
added deallocate memory logic for
NotificationMessage when send notification failed.

Change-Id: I3feca075a06df9f6ba5cc90bdf9ff51cde279b60
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10211
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/notification/src/provider/NSProviderNotification.c

index 3b1dced..f6f7da9 100644 (file)
@@ -162,8 +162,8 @@ NSResult NSSendNotification(NSMessage *msg)
         OCRepPayloadDestroy(payload);
         return NS_ERROR;
     }
+
     OCRepPayloadDestroy(payload);
-    NSFreeMessage(msg);
 
     NS_LOG(DEBUG, "NSSendMessage - OUT");
 
@@ -269,6 +269,7 @@ void * NSNotificationSchedule(void *ptr)
                 {
                     NS_LOG(DEBUG, "CASE TASK_SEND_NOTIFICATION : ");
                     NSSendNotification((NSMessage *)node->taskData);
+                    NSFreeMessage((NSMessage *)node->taskData);
                     break;
                 }
                 case TASK_SEND_READ: