ciot_wifi_multi_new() can allocate an internal Wi-Fi instance (own_wifi=true). On the init-failure path, the code frees self but does not free the internally created self->base.wifi, leaking memory. More broadly, there is no public destroy function to stop and free the owned Wi-Fi/TCP instance when own_wifi=true. Consider adding ciot_wifi_multi_delete() (stop + restore handler + free owned wifi if any + free self) and using it for cleanup in error paths and tests.
Originally posted by @Copilot in #41 (comment)
ciot_wifi_multi_new() can allocate an internal Wi-Fi instance (own_wifi=true). On the init-failure path, the code frees
selfbut does not free the internally createdself->base.wifi, leaking memory. More broadly, there is no public destroy function to stop and free the owned Wi-Fi/TCP instance when own_wifi=true. Consider adding ciot_wifi_multi_delete() (stop + restore handler + free owned wifi if any + free self) and using it for cleanup in error paths and tests.Originally posted by @Copilot in #41 (comment)