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

Should we call coap_mem_release() on pMsg if PayloadMaxSize is exceeded? #39

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

Comments

@ChrisDinhNZ
Copy link

Hi there,
When we call CoAP_CreateMessage(), we allocate some buffer for the message. After successfully allocating the buffer we check PayloadMaxSize and return null if exceeded. Should we free the buffer prior to returning or are we relying on the caller to clean up the buffer?

return NULL;

@niondir
Copy link
Member

niondir commented Sep 24, 2019

I guess a free is missing there, the caller has no reference to the allocated memory as far as I see.

PR is welcome.

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

Successfully merging a pull request may close this issue.

2 participants