From a8a50800631e866635ea09efea63d7c3dcacb245 Mon Sep 17 00:00:00 2001 From: Michael Sandstedt Date: Mon, 20 Dec 2021 11:25:30 -0600 Subject: [PATCH] fix for #12943, ResolverProxy::Init does not check for allocation failure --- src/lib/dnssd/ResolverProxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/dnssd/ResolverProxy.h b/src/lib/dnssd/ResolverProxy.h index e7ce4fa10c408f..43c7184218559e 100644 --- a/src/lib/dnssd/ResolverProxy.h +++ b/src/lib/dnssd/ResolverProxy.h @@ -68,7 +68,7 @@ class ResolverProxy : public Resolver ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(udpEndPoint)); VerifyOrReturnError(mDelegate == nullptr, CHIP_ERROR_INCORRECT_STATE); mDelegate = chip::Platform::New(); - return CHIP_NO_ERROR; + return mDelegate != nullptr ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; } void SetResolverDelegate(ResolverDelegate * delegate) override