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