From 6ea23ce716efac44a8b39c7e7dea80c43555deef Mon Sep 17 00:00:00 2001 From: Hyunjin Park Date: Wed, 9 Sep 2015 14:09:52 +0900 Subject: [PATCH] [notification] fix prevent CID 24596 - add SCOPE_EXIT to prevent resource leak - TCT result : 100% passed Change-Id: Ibac5e2c719c092d56804921a0876f5597dd8cbb6 --- src/notification/notification_manager.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/notification/notification_manager.cc b/src/notification/notification_manager.cc index ef17319b..9da44d4e 100644 --- a/src/notification/notification_manager.cc +++ b/src/notification/notification_manager.cc @@ -168,9 +168,16 @@ PlatformResult NotificationManager::GetAll(picojson::array& out) { "Cannot get notification id error"); } - app_control_h app_control; + app_control_h app_control = nullptr; PlatformResult status = StatusNotification::GetAppControl(noti, &app_control); + + SCOPE_EXIT { + if (app_control) { + app_control_destroy(app_control); + } + }; + if (status.IsError()) return status; -- 2.34.1