Commit Diff
- Commit:
c29b0f4c291d5ed73f7e1d388bc6d4d4809483a1
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
- Message:
- gotwebd: plug leak in get_addrs() error path h is free'd by add_addr in case of error, but we still leak the getaddrinfo result. while here make the check strictier: addr_addr() fails with -1.
- Actions:
- Patch | Tree
--- gotwebd/parse.y +++ gotwebd/parse.y @@ -1065,8 +1065,10 @@ get_addrs(const char *hostname, const char *servname, fatalx("unknown address family %d", res->ai_family); } - if (add_addr(new_srv, h)) + if (add_addr(new_srv, h) == -1) { + freeaddrinfo(res0); return -1; + } } freeaddrinfo(res0); return (0);