summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawrence Teo <lteo@cvs.openbsd.org>2015-01-01 03:27:57 +0000
committerLawrence Teo <lteo@cvs.openbsd.org>2015-01-01 03:27:57 +0000
commitcbf599b97fda7226a007c6f3c4b41bce291f96be (patch)
tree8a42d6ea7b2dc00f7bdb153e6bf99000f7206898
parent8ebaf838ba90490b8991530c93415baa8c15cc17 (diff)
Remove an unnecessary freeaddrinfo() call, since errx() would free all
the memory including the one allocated by the earlier getaddrinfo() (pointed out by claudio@). feedback from claudio@ ok bluhm@
-rw-r--r--usr.sbin/tcpdrop/tcpdrop.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c
index add2236e3ab..6b1fb7414a9 100644
--- a/usr.sbin/tcpdrop/tcpdrop.c
+++ b/usr.sbin/tcpdrop/tcpdrop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdrop.c,v 1.14 2014/06/29 00:58:45 deraadt Exp $ */
+/* $OpenBSD: tcpdrop.c,v 1.15 2015/01/01 03:27:56 lteo Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
@@ -106,11 +106,9 @@ fail:
errx(1, "%s port %s: %s", addr1, port1,
gai_strerror(gaierr));
- if ((gaierr = getaddrinfo(faddr2, port2, &hints, &faddr)) != 0) {
- freeaddrinfo(laddr);
+ if ((gaierr = getaddrinfo(faddr2, port2, &hints, &faddr)) != 0)
errx(1, "%s port %s: %s", addr2, port2,
gai_strerror(gaierr));
- }
rval = 1;
for (ail = laddr; ail; ail = ail->ai_next) {