summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-08-24 12:45:08 +0000
committerclaudio <claudio@openbsd.org>2010-08-24 12:45:08 +0000
commita6090a0515d29477879ab370ffbb49266691f35e (patch)
treed5fcc07c5c61d7e8640e69853c02b6e71a177989
parent- plugs two fd leaks (diff)
downloadwireguard-openbsd-a6090a0515d29477879ab370ffbb49266691f35e.tar.xz
wireguard-openbsd-a6090a0515d29477879ab370ffbb49266691f35e.zip
last is a pointer so initialize to NULL and not 0. Also move initialization
up to the declaration.
-rw-r--r--sys/net/rtsock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 3a9bcae337b..9a424137104 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.105 2010/07/14 20:56:35 claudio Exp $ */
+/* $OpenBSD: rtsock.c,v 1.106 2010/08/24 12:45:08 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -302,7 +302,7 @@ route_input(struct mbuf *m0, ...)
struct routecb *rop;
struct mbuf *m = m0;
int sockets = 0;
- struct socket *last;
+ struct socket *last = NULL;
va_list ap;
struct sockproto *proto;
struct sockaddr *sosrc, *sodst;
@@ -319,7 +319,6 @@ route_input(struct mbuf *m0, ...)
return;
}
- last = 0;
LIST_FOREACH(rp, &rawcb, rcb_list) {
if (rp->rcb_proto.sp_family != proto->sp_family)
continue;