diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 0e7ab15fe6e33a..5259b869cc4fcf 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -300,6 +300,10 @@ CHIP_ERROR ReadClient::OnMessageReceived(Messaging::ExchangeContext * apExchange { VerifyOrExit(apExchangeContext == mpExchangeCtx, err = CHIP_ERROR_INCORRECT_STATE); err = ProcessSubscribeResponse(std::move(aPayload)); + // Forget the context as SUBSCRIBE RESPONSE is the last message in SUBSCRIBE transaction and + // ExchangeContext::HandleMessage automatically closes a context if other messages need to + // be sent or received. + mpExchangeCtx = nullptr; SuccessOrExit(err); } else