Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoAP_AllocRespMsg() could return null here #40

Closed
ChrisDinhNZ opened this issue Sep 23, 2019 · 1 comment
Closed

CoAP_AllocRespMsg() could return null here #40

ChrisDinhNZ opened this issue Sep 23, 2019 · 1 comment

Comments

@ChrisDinhNZ
Copy link

If CoAP_AllocRespMsg() returns null here, do you think we can just return without calling SendResp()?

pIA->pRespMsg = CoAP_AllocRespMsg(pIA->pReqMsg, RESP_METHOD_NOT_ALLOWED_4_05, 0); //matches also TYPE + TOKEN to request

@niondir
Copy link
Member

niondir commented Sep 24, 2019

I think so, yes. It makes no sense to send out garbage. But we should ERROR log the failed malloc at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants