From da5e79fd995463ce5db6476bbe9ddab74d3e7734 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Mon, 2 Dec 2019 15:27:57 +0900 Subject: Fix double free Change-Id: I96fe552053fe04ea5b4f3613e80fcdfb457219cd Signed-off-by: Jusung Son --- notification-ex/stub.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'notification-ex') diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 14dab89..0f0d6d6 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; } -- cgit v1.2.3