-/* $OpenBSD: pfctl_parser.c,v 1.327 2018/08/10 09:54:06 kn Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.328 2018/09/05 08:47:21 kn Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
flags |= PFI_AFLAG_PEER;
else if (!strcmp(p+1, "0"))
flags |= PFI_AFLAG_NOALIAS;
- else {
- free(ps);
- return (NULL);
- }
+ else
+ goto error;
*p = '\0';
}
if (flags & (flags - 1) & PFI_AFLAG_MODEMASK) { /* Yep! */
fprintf(stderr, "illegal combination of interface modifiers\n");
- free(ps);
- return (NULL);
+ goto error;
}
if ((flags & (PFI_AFLAG_NETWORK|PFI_AFLAG_BROADCAST)) && mask > -1) {
fprintf(stderr, "network or broadcast lookup, but "
"extra netmask given\n");
- free(ps);
- return (NULL);
+ goto error;
}
if (ifa_exists(ps) || !strncmp(ps, "self", IFNAMSIZ)) {
/* interface with this name exists */
set_ipmask(n, mask);
}
+error:
free(ps);
return (h);
}