-/* $OpenBSD: pfctl_parser.c,v 1.321 2018/07/10 09:30:49 henning Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.322 2018/07/24 09:38:21 kn Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
{
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)
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 &&
}
}
freeaddrinfo(res0);
+error:
free(ps);
return (h);