Skip to content

Commit

Permalink
Add check for failed allocation in ResolverProxy::Init
Browse files Browse the repository at this point in the history
  • Loading branch information
msandstedt committed Dec 22, 2021
1 parent 7fcffcf commit 3b6b16a
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 3b6b16a

Please sign in to comment.