bstansell / conserver

Logged, multi-user access to device consoles
https://www.conserver.com/
BSD 3-Clause "New" or "Revised" License
129 stars 38 forks source link

In AddrsMatch, keep copies of addrinfos to free. #98

Closed daztucker closed 6 months ago

daztucker commented 6 months ago

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

In the best case this fixes a mem leak. In implementations such as musl where freeaddrinfo(NULL) is not safe (which is not required by the spec), this fixes a segfault.

(I used the "rp" names to be consistent with other similar loops elsewhere in the code.)

daztucker commented 6 months ago

The test failure seems to be an infrastructure failure (the request to start the VM 404s).