From 8bdddb99b5105fb1d4c7213a5a8d5b4227c8d631 Mon Sep 17 00:00:00 2001 From: lteo Date: Thu, 1 Jan 2015 03:27:56 +0000 Subject: [PATCH] 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@ --- usr.sbin/tcpdrop/tcpdrop.c | 6 ++---- 1 file 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 @@ -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) { -- 2.20.1