From 1b9709ca24744662cb6265c2e7f705e9accca838 Mon Sep 17 00:00:00 2001 From: onexiaomin Date: Sat, 19 Nov 2022 14:33:41 +0800 Subject: [PATCH] fixed 965fd8f from https://gitee.com/onexiaomin/filemanagement_user_file_service_wp_2/pulls/305 clean code check warning about not releasing memory Description: clean code check warning about not releasing memory Sig:OpenHarmony/filemanagement_user_file_service Feature or Bugfix:Bugfix Binary Source: No Signed-off-by: onexiaomin --- .../kits/napi/file_access_module/napi_notify_callback.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interfaces/kits/napi/file_access_module/napi_notify_callback.cpp b/interfaces/kits/napi/file_access_module/napi_notify_callback.cpp index 9c59a2de..2b9e47a1 100644 --- a/interfaces/kits/napi/file_access_module/napi_notify_callback.cpp +++ b/interfaces/kits/napi/file_access_module/napi_notify_callback.cpp @@ -87,6 +87,11 @@ int NapiNotifyCallback::OnNotify(const NotifyMessage& message) work = nullptr; return ERR_NOTIFY_FAIL; } + + delete (CallbackParam *)(work->data); + work->data = nullptr; + delete work; + work = nullptr; return ERR_OK; } } // namespace FileAccessFwk -- Gitee