From 1624ed9bd4bf6d9e23431304724237617f2340a0 Mon Sep 17 00:00:00 2001 From: junyi233 Date: Wed, 23 Aug 2023 03:46:36 +0000 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: junyi233 --- frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp b/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp index 42cc307..4350337 100644 --- a/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp +++ b/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp @@ -72,6 +72,9 @@ bool BundleMsClient::Install(const char *hapPath, const InstallParam *installPar return false; } Bmsbuff *data = static_cast(AdapterMalloc(sizeof(Bmsbuff))); + if (data == nullptr) { + return false; + } if (memcpy_s(data->bundleParameter, MAX_PATH_LEN, hapPath, len + 1) != 0) { AdapterFree(data); return false; @@ -103,6 +106,9 @@ bool BundleMsClient::Uninstall (const char *bundleName, const InstallParam *inst return false; } Bmsbuff *data = static_cast(AdapterMalloc(sizeof(Bmsbuff))); + if (data == nullptr) { + return false; + } if (memcpy_s(data->bundleParameter, MAX_PATH_LEN, bundleName, len + 1) != 0) { AdapterFree(data); return false;