- SCOPE_EXIT position is after return statement.
- move it before return statement.
- TCT result : 100% passed
Change-Id: I17ce78347220872d6062b4ec1f440cf0293d6f11
int id = std::stoi(FromJson<std::string>(args, "id"));
app_control_h app_control = nullptr;
- notification_h noti_handle;
- PlatformResult status = StatusNotification::GetNotiHandle(id, ¬i_handle);
- if (status.IsError())
- {
- LoggerE("Failed: GetNotiHandle");
- return status;
- }
+ notification_h noti_handle = nullptr;
SCOPE_EXIT {
if (app_control) {
free(noti_handle);
};
+ PlatformResult status = StatusNotification::GetNotiHandle(id, ¬i_handle);
+ if (status.IsError())
+ {
+ LoggerE("Failed: GetNotiHandle");
+ return status;
+ }
+
status = StatusNotification::GetAppControl(noti_handle, &app_control);
if (status.IsError())
{
int id = NOTIFICATION_PRIV_ID_NONE;
int ret;
- notification_h noti_handle;
+ notification_h noti_handle = nullptr;
app_control_h app_control = NULL;
+
+ SCOPE_EXIT {
+ if (app_control) {
+ app_control_destroy(app_control);
+ }
+ free(noti_handle);
+ };
+
if (is_update) {
id = std::stoi(common::FromJson<std::string>(noti_obj, "id"));
return status;
}
- SCOPE_EXIT {
- if (app_control) {
- app_control_destroy(app_control);
- }
- free(noti_handle);
- };
-
status = SetLayout(noti_handle, status_type);
if (status.IsError()) {
return status;