summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-02-01 07:45:54 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-02-01 07:45:54 +0000
commit2ed59f5d5f5a8eee93b885af7f0fd86ee3918224 (patch)
tree7ff6092e405c68acc1c019c0eb9b440679d1f00d /sys/netinet
parentd46e658724881ccd5f6c121bbf7bd593b752ae70 (diff)
remove the correct KFREE
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_nat.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/netinet/ip_nat.c b/sys/netinet/ip_nat.c
index 2bd313c0c42..cb868ed521d 100644
--- a/sys/netinet/ip_nat.c
+++ b/sys/netinet/ip_nat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_nat.c,v 1.18 1999/01/29 07:01:46 d Exp $ */
+/* $OpenBSD: ip_nat.c,v 1.19 1999/02/01 07:45:53 d Exp $ */
/*
* Copyright (C) 1995-1997 by Darren Reed.
*
@@ -10,7 +10,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.18 1999/01/29 07:01:46 d Exp $";
+static const char rcsid[] = "@(#)$Id: ip_nat.c,v 1.19 1999/02/01 07:45:53 d Exp $";
#endif
#if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL)
@@ -517,12 +517,8 @@ struct in_addr *inp;
if (ifa)
sin = (SOCKADDR_IN *)ifa->ifa_addr;
}
- if (!ifa)
- sin = NULL;
- if (!sin) {
- KFREE(nat);
+ if (!ifa || !sin)
return -1;
- }
# endif /* (BSD < 199306) && (!__sgi && IFF_DRVLOCK) */
in = sin->sin_addr;
in.s_addr = ntohl(in.s_addr);
@@ -580,8 +576,10 @@ int direction;
in.s_addr = np->in_nip;
if (!in.s_addr && (np->in_outmsk == 0xffffffff)) {
if ((l > 1) ||
- nat_ifpaddr(nat, fin->fin_ifp, &in) == -1)
+ nat_ifpaddr(nat, fin->fin_ifp, &in) == -1) {
+ KFREE(nat);
return NULL;
+ }
} else if (!in.s_addr && !np->in_outmsk) {
if (l > 1) {
KFREE(nat);
@@ -1336,7 +1334,7 @@ void *ifp;
*/
sum1 = nat->nat_outip.s_addr;
if (nat_ifpaddr(nat, ifp, &in) == -1)
- nat->nat_outip.s_addr = htonl(in.s_addr);
+ nat->nat_outip.s_addr = htonl(in.s_addr);
sum2 = nat->nat_outip.s_addr;
/*