summaryrefslogtreecommitdiff
path: root/notification-ex
diff options
context:
space:
mode:
authorJusung Son <jusung07.son@samsung.com>2019-12-02 15:27:57 +0900
committerJusung Son <jusung07.son@samsung.com>2019-12-02 15:27:57 +0900
commitda5e79fd995463ce5db6476bbe9ddab74d3e7734 (patch)
tree8a94643e433ecfe0707f9166037fb4a99968bc37 /notification-ex
parentebd6a0a8ea5d05c95ac10269b62bb872173be0ca (diff)
downloadnotification-da5e79fd995463ce5db6476bbe9ddab74d3e7734.tar.gz
notification-da5e79fd995463ce5db6476bbe9ddab74d3e7734.tar.bz2
notification-da5e79fd995463ce5db6476bbe9ddab74d3e7734.zip
Fix double free
Change-Id: I96fe552053fe04ea5b4f3613e80fcdfb457219cd Signed-off-by: Jusung Son <jusung07.son@samsung.com>
Diffstat (limited to 'notification-ex')
-rw-r--r--notification-ex/stub.cc10
1 files changed, 9 insertions, 1 deletions
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<AbstractAction>* ptr =
static_cast<shared_ptr<AbstractAction>*>(handle);
AppControlAction* action = static_cast<AppControlAction*>(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;
}