ArduinoMDNS icon indicating copy to clipboard operation
ArduinoMDNS copied to clipboard

Fix invalid call to free() in 'addServiceRecord'

Open jf-0 opened this issue 2 years ago • 0 comments

If some memory allocation in the member function addServiceRecord fails it will call 'goto errorReturn;'. At errorReturn there is a call to my_free which ALWAYS frees 'record->servName' at the moment.

This PR sets servName to 0, which will later prevent the call to free (if it is called too early)

Live-Screenshot of the bug: image assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas"

jf-0 avatar Jun 28 '23 18:06 jf-0