config: fix memleak during odhcpd reload
authorFei Lv <[email protected]>
Fri, 14 Nov 2025 07:31:22 +0000 (15:31 +0800)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 14 Nov 2025 16:27:45 +0000 (17:27 +0100)
commitbe7ca7c0792b185263ad86b961ea61129494a7f9
tree15f56988f75c0fe0a706e6855d23f15219d78b41
parent366bd81804a6891e98d55cf77f836c1cd3bfd595
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]>
src/config.c