conserver: free correct addrinfo to prevent crash.
authorDarren Tucker <dtucker@dtucker.net>
Thu, 15 Feb 2024 08:33:05 +0000 (19:33 +1100)
committerRosen Penev <rosenp@gmail.com>
Sat, 24 Feb 2024 20:14:18 +0000 (12:14 -0800)
commit69b24ecf6f92feed56ae91cfcf5b56240d90104c
tree93f3bfedef0a8c6d5291228a386cb6aa1aefb962
parent9e7739057f0e1621675a589bc7c2a7a080c97a20
conserver: free correct addrinfo to prevent crash.

When looping through addrinfo lists in AddrsMatch, keep a copy of the
original addrinfo pointers to free instead of ending up at the terminating
NULLs and trying to free those.

OpenWRT uses musl in which freeaddrinfo(NULL) is not safe (which is
fine, it's not required by the spec) so this fixes a segfault.

Signed-off-by: Darren Tucker <dtucker@dtucker.net>
net/conserver/Makefile
net/conserver/patches/002-addrsmatch-freeaddrinfo.patch [new file with mode: 0644]