From: Hyunjin Park Date: Wed, 9 Sep 2015 05:09:52 +0000 (+0900) Subject: [notification] fix prevent CID 24596 X-Git-Tag: submit/tizen/20151026.073646^2^2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ea23ce716efac44a8b39c7e7dea80c43555deef;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [notification] fix prevent CID 24596 - add SCOPE_EXIT to prevent resource leak - TCT result : 100% passed Change-Id: Ibac5e2c719c092d56804921a0876f5597dd8cbb6 --- 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;