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 Aug 24, 2023
1 parent 14d9625 commit 7f2eee6
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 7f2eee6

Please sign in to comment.