config: fix memleak during odhcpd reload
- The memset in close_interface reset the pios pointer before it
could be freed, causing a memory leak. Relocate the free call
to clean_interface to ensure proper deallocation.
- Use realloc instead of malloc in config_load_ra_pio()
This function may be called multiple times during odhcpd reload,
and using malloc without freeing the previous allocation was
causing memory leaks.
Signed-off-by: Fei Lv <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/309
Signed-off-by: Álvaro Fernández Rojas <[email protected]>