From 2308616e79d52734f533665b8fb3beeb9c291366 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 7 Mar 2023 21:13:50 +0100 Subject: [PATCH] [Bindings] Add a missing null check (#25534) --- src/app/clusters/bindings/BindingManager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/clusters/bindings/BindingManager.cpp b/src/app/clusters/bindings/BindingManager.cpp index 35ebecda2b3be4..a84466cd17b90d 100644 --- a/src/app/clusters/bindings/BindingManager.cpp +++ b/src/app/clusters/bindings/BindingManager.cpp @@ -108,6 +108,8 @@ CHIP_ERROR BindingManager::EstablishConnection(const ScopedNodeId & nodeId) mLastSessionEstablishmentError = CHIP_NO_ERROR; auto * connectionCallback = Platform::New(*this); + VerifyOrReturnError(connectionCallback != nullptr, CHIP_ERROR_NO_MEMORY); + mInitParams.mCASESessionManager->FindOrEstablishSession(nodeId, connectionCallback->GetOnDeviceConnected(), connectionCallback->GetOnDeviceConnectionFailure()); if (mLastSessionEstablishmentError == CHIP_ERROR_NO_MEMORY)