summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2003-01-18 22:23:00 +0000
committerdhartmei <dhartmei@openbsd.org>2003-01-18 22:23:00 +0000
commit57fb52ac0ee2a48b032cc4c975e37c86a3019ded (patch)
tree078287d9d030fbdf90570adf4a9237869fbb23d0
parentva_end() missing. Thanks to Andrey Matveev. (diff)
downloadwireguard-openbsd-57fb52ac0ee2a48b032cc4c975e37c86a3019ded.tar.xz
wireguard-openbsd-57fb52ac0ee2a48b032cc4c975e37c86a3019ded.zip
Move freeaddrinfo() so it doesn't get called with an uninitialized
pointer (which segfaults). From Julien Bordet.
-rw-r--r--sbin/pfctl/pfctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 903214aa111..d65d6a0224b 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.134 2003/01/18 15:00:24 cedric Exp $ */
+/* $OpenBSD: pfctl.c,v 1.135 2003/01/18 22:23:00 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -416,6 +416,7 @@ pfctl_kill_states(int dev, int opts)
/* fixup psk.psk_af */
psk.psk_af = resp[1]->ai_family;
}
+ freeaddrinfo(res[1]);
} else {
if (ioctl(dev, DIOCKILLSTATES, &psk))
err(1, "DIOCKILLSTATES");
@@ -426,8 +427,6 @@ pfctl_kill_states(int dev, int opts)
}
freeaddrinfo(res[0]);
- if (res[1])
- freeaddrinfo(res[1]);
if ((opts & PF_OPT_QUIET) == 0)
fprintf(stderr, "killed %d states from %d sources and %d "