From bbde44f8f376b946c4a0639a45dfcc69d635be2e Mon Sep 17 00:00:00 2001 From: wu-liushuan Date: Tue, 1 Jul 2025 15:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B920250701?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wu-liushuan Change-Id: I05b2abc62e063439ceefb2cdb2e0c63f6c78e80e --- .../innerkits/accesstoken/src/accesstoken_manager_client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_manager_client.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_manager_client.cpp index 1f35651ae..054166843 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_manager_client.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_manager_client.cpp @@ -918,6 +918,10 @@ int32_t AccessTokenManagerClient::RegisterTokenSyncCallback( } sptr callback = sptr(new (std::nothrow) TokenSyncCallback(syncCallback)); + if (callback == nullptr) { + LOGE(ATM_DOMAIN, ATM_TAG, "Memory allocation for callback failed!"); + return AccessTokenError::ERR_MALLOC_FAILED; + } std::lock_guard lock(tokenSyncCallbackMutex_); int32_t res = proxy->RegisterTokenSyncCallback(callback->AsObject()); -- Gitee