Fix memory leak 56/257356/1
authorhyunho <hhstark.kang@samsung.com>
Fri, 23 Apr 2021 04:18:14 +0000 (13:18 +0900)
committerhyunho <hhstark.kang@samsung.com>
Fri, 23 Apr 2021 04:18:14 +0000 (13:18 +0900)
Change-Id: I980611696f69a7b95384ddaab691da1bfa8e3202
Signed-off-by: hyunho <hhstark.kang@samsung.com>
notification-ex/stub.cc

index 7563eef..cd6b60a 100644 (file)
@@ -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;
   }