From a9fed9835fb5d9eaa0a866f745cf59f207544a47 Mon Sep 17 00:00:00 2001 From: "jaesick.shin" Date: Thu, 18 Aug 2016 12:54:23 +0900 Subject: [PATCH] Add Util for related Topic. NSMessage include topic. so Add util for related topic in NSUtil.c Change-Id: I5be2dd86667508e999af08c7634755cdbffd7885 Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/10573 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/notification/src/common/NSUtil.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/notification/src/common/NSUtil.c b/service/notification/src/common/NSUtil.c index be70df7..ec689ec 100755 --- a/service/notification/src/common/NSUtil.c +++ b/service/notification/src/common/NSUtil.c @@ -95,6 +95,7 @@ NSResult NSFreeMessage(NSMessage * obj) NSFreeMalloc(&(obj->title)); NSFreeMalloc(&(obj->contentText)); NSFreeMalloc(&(obj->sourceName)); + NSFreeMalloc(&(obj->topic)); NSFreeMediaContents(obj->mediaContents); OICFree(obj); @@ -144,6 +145,11 @@ NSMessage * NSDuplicateMessage(NSMessage * copyMsg) newMsg->mediaContents = NSDuplicateMediaContents(copyMsg->mediaContents); } + if (copyMsg->topic) + { + newMsg->topic = OICStrdup(copyMsg->topic); + } + return newMsg; } @@ -421,6 +427,7 @@ NSMessage * NSInitializeMessage() msg->contentText = NULL; msg->sourceName = NULL; msg->mediaContents = NULL; + msg->topic = NULL; return msg; } -- 2.7.4