From f322d344dc9453572b8dfc449eef9a0666e78373 Mon Sep 17 00:00:00 2001 From: wufarong1 Date: Mon, 26 Aug 2024 20:41:23 +0800 Subject: [PATCH] =?UTF-8?q?ANS=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86=20?= =?UTF-8?q?=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/ans/src/notification_local_live_view_button.cpp | 1 + frameworks/ans/src/notification_request.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/ans/src/notification_local_live_view_button.cpp b/frameworks/ans/src/notification_local_live_view_button.cpp index 81d163d51..df5bb1d07 100644 --- a/frameworks/ans/src/notification_local_live_view_button.cpp +++ b/frameworks/ans/src/notification_local_live_view_button.cpp @@ -172,6 +172,7 @@ NotificationLocalLiveViewButton *NotificationLocalLiveViewButton::FromJson(const auto pIcon = AnsImageUtil::UnPackImage(iconObj.get()); if (pIcon == nullptr) { ANS_LOGE("Failed to parse button icon"); + delete button; return nullptr; } button->buttonIcons_.emplace_back(pIcon); diff --git a/frameworks/ans/src/notification_request.cpp b/frameworks/ans/src/notification_request.cpp index 90ce75934..abb966fe2 100644 --- a/frameworks/ans/src/notification_request.cpp +++ b/frameworks/ans/src/notification_request.cpp @@ -2255,7 +2255,7 @@ bool NotificationRequest::ConvertJsonToNotificationDistributedOptions( target->distributedOptions_ = *pOpt; } } - + delete pOpt; return true; } -- Gitee