From: Jusung Son Date: Mon, 2 Dec 2019 06:27:57 +0000 (+0900) Subject: Fix double free X-Git-Tag: submit/tizen_5.5/20191203.052307^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da5e79fd995463ce5db6476bbe9ddab74d3e7734;p=platform%2Fcore%2Fapi%2Fnotification.git Fix double free Change-Id: I96fe552053fe04ea5b4f3613e80fcdfb457219cd Signed-off-by: Jusung Son --- diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 14dab89e..0f0d6d63 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -337,7 +337,15 @@ extern "C" EXPORT_API int noti_ex_action_app_control_get( shared_ptr* ptr = static_cast*>(handle); AppControlAction* action = static_cast(ptr->get()); - *app_control = action->GetAppControl(); + + app_control_h clone; + int r = app_control_clone(&clone, action->GetAppControl()); + if (r != APP_CONTROL_ERROR_NONE) { + LOGE("failed to create a app_control handle : %d", r); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + *app_control = clone; return NOTI_EX_ERROR_NONE; }