We're not using `error' anyway so drop the variable and jump to the end.
OK?
Index: pfctl_parser.c
===================================================================
RCS file: /cvs/src/sbin/pfctl/pfctl_parser.c,v
retrieving revision 1.321
diff -u -p -r1.321 pfctl_parser.c
--- pfctl_parser.c 10 Jul 2018 09:30:49 -0000 1.321
+++ pfctl_parser.c 22 Jul 2018 10:47:47 -0000
@@ -1806,8 +1806,7 @@ host_dns(const char *s, int v4mask, int
{
struct addrinfo hints, *res0, *res;
struct node_host *n, *h = NULL;
- int error, noalias = 0;
- int got4 = 0, got6 = 0;
+ int noalias = 0, got4 = 0, got6 = 0;
char *p, *ps;
if ((ps = strdup(s)) == NULL)
@@ -1821,11 +1820,8 @@ host_dns(const char *s, int v4mask, int
hints.ai_socktype = SOCK_STREAM; /* DUMMY */
if (numeric)
hints.ai_flags = AI_NUMERICHOST;
- error = getaddrinfo(ps, NULL, &hints, &res0);
- if (error) {
- free(ps);
- return (h);
- }
+ if (getaddrinfo(ps, NULL, &hints, &res0) != 0)
+ goto error;
for (res = res0; res; res = res->ai_next) {
if (res->ai_family != AF_INET &&
@@ -1873,6 +1869,7 @@ host_dns(const char *s, int v4mask, int
}
}
freeaddrinfo(res0);
+error:
free(ps);
return (h);