Commit Diff
- Commit:
eb916dafa2967bc60a8996ea7cc0a23a661ed88e
- From:
- Omar Polo <op@omarpolo.com>
- 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 @@ -1064,8 +1064,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);