Skip to content

Commit

Permalink
Add check for failed allocation in ResolverProxy::Init (#13290)
Browse files Browse the repository at this point in the history
Fixes #12943
  • Loading branch information
msandstedt authored and pull[bot] committed Mar 3, 2022
1 parent b14bfc6 commit 3368149
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/dnssd/ResolverProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResolverDelegateProxy>();
return CHIP_NO_ERROR;
return mDelegate != nullptr ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY;
}

void SetResolverDelegate(ResolverDelegate * delegate) override
Expand Down

0 comments on commit 3368149

Please sign in to comment.