summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-03-12 17:49:24 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-03-12 17:49:24 +0000
commit6660317ffd9471a67a9a2420a07e9436a29924c7 (patch)
treeab9a370ccf7bf8feda429734953c87458ff5a408 /sys
parentedbc537763930b6a7a79fa2a965e2d33672ca5f2 (diff)
Fix rtentry leak in in_losing(). The rtentry needs to be freed in anycase.
Found by Greg Wooledge. A lot of debugging and help by dhartmei@ markus@ cedric@. OK dhartmei@ markus@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/in_pcb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index b5ed192fab5..bcb820627d5 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.74 2004/01/02 16:08:54 markus Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.75 2004/03/12 17:49:23 claudio Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -693,12 +693,13 @@ in_losing(inp)
(void) rtrequest(RTM_DELETE, rt_key(rt),
rt->rt_gateway, rt_mask(rt), rt->rt_flags,
(struct rtentry **)0);
- else
/*
* A new route can be allocated
* the next time output is attempted.
+ * rtfree() needs to be called in anycase because the inp
+ * is still holding a reference to rt.
*/
- rtfree(rt);
+ rtfree(rt);
}
}