From 9fc79b61d06f4423367f82baf73e275142c858cb Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 23 Apr 2021 13:18:14 +0900 Subject: [PATCH] Fix memory leak Change-Id: I980611696f69a7b95384ddaab691da1bfa8e3202 Signed-off-by: hyunho --- notification-ex/stub.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 7563eef..cd6b60a 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -1565,6 +1565,8 @@ extern "C" EXPORT_API int noti_ex_style_get_padding(noti_ex_style_h handle, new (std::nothrow) Padding(*((*p)->GetPadding()))); if (padd == nullptr || padd->get() == nullptr) { LOGE("Out-of-memory"); + if (padd) + delete padd; *padding = nullptr; return NOTI_EX_ERROR_NONE; } -- 2.7.4