fix: Free allocated memory for query params

When the query param is parsed we allocate memory. In case of an invalid
content type that memory is not freed anymore.
This commit is contained in:
Lukas Woodtli 2024-02-12 17:03:32 +01:00 committed by Lukas Woodtli
parent 01489dbe07
commit 77d38b8257

View File

@ -1798,6 +1798,7 @@ uint8_t registration_handleRequest(lwm2m_context_t * contextP,
if (message->content_type != (coap_content_type_t)LWM2M_CONTENT_LINK
&& message->content_type != (coap_content_type_t)LWM2M_CONTENT_TEXT)
{
lwm2m_free(name);
return COAP_400_BAD_REQUEST;
}