diff options
author | kn <kn@cvs.openbsd.org> | 2018-09-08 14:45:56 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2018-09-08 14:45:56 +0000 |
commit | 1e92d1f75deba86b05697f0d537befea227e9697 (patch) | |
tree | 74232fbf0b27c5b90f8b2b4f2769a573dbb3c1fc /sbin/pfctl/pfctl.c | |
parent | 53a30a24488fa870997b75e31d7d9b42068cfcac (diff) |
Allocate path only when needed, use __func__
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r-- | sbin/pfctl/pfctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index f65ebb77254..b08f7302337 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.358 2018/09/08 14:12:57 kn Exp $ */ +/* $OpenBSD: pfctl.c,v 1.359 2018/09/08 14:45:55 kn Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -2496,8 +2496,6 @@ main(int argc, char *argv[]) /* NOTREACHED */ } - if ((path = calloc(1, PATH_MAX)) == NULL) - errx(1, "pfctl: calloc"); memset(anchorname, 0, sizeof(anchorname)); if (anchoropt != NULL) { if (mode == O_RDONLY && showopt == NULL) { @@ -2541,6 +2539,9 @@ main(int argc, char *argv[]) if (pfctl_disable(dev, opts)) error = 1; + if ((path = calloc(1, PATH_MAX)) == NULL) + errx(1, "%s: calloc", __func__); + if (showopt != NULL) { switch (*showopt) { case 'A': |