Permalink
Browse files

avoid overfree in defrouter_delreq

(same fix as snap)
  • Loading branch information...
1 parent edee1d9 commit 5e34bf350525225c7740c4210c7901cc23c3d4fe jinmei committed Aug 11, 2000
Showing with 9 additions and 4 deletions.
  1. +9 −4 kame/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $KAME: nd6_rtr.c,v 1.42 2000/06/16 12:38:15 jinmei Exp $ */
+/* $KAME: nd6_rtr.c,v 1.42.2.1 2000/08/11 12:18:32 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -598,9 +598,14 @@ defrouter_delreq(dr, dofree)
#ifdef ND6_USE_RTSOCK
defrouter_msg(RTM_DELETE, oldrt);
#endif
- if (oldrt->rt_refcnt <= 0)
- oldrt->rt_refcnt++; /* XXX */
- rtfree(oldrt);
+ if (oldrt->rt_refcnt <= 0) {
+ /*
+ * XXX: borrowed from the RTM_DELETE case of
+ * rtrequest().
+ */
+ oldrt->rt_refcnt++;
+ rtfree(oldrt);
+ }
}
if (dofree) /* XXX: necessary? */

0 comments on commit 5e34bf3

Please sign in to comment.