From 08e4f0700238abdec48bc342149c006d102636e5 Mon Sep 17 00:00:00 2001 From: green Date: Wed, 22 Mar 2000 02:27:30 +0000 Subject: in6_pcb.c: Remove a bogus (redundant, just weird, etc.) key_freeso(so). There are no consumers of it now, nor does it seem there ever will be. in6?_pcb.c: Add an if (inp->in6?p_sp != NULL) before the call to ipsec[46]_delete_pcbpolicy(inp). In low-memory conditions this can cause a crash because in6?_sp can be NULL... --- sys/netinet6/in6_pcb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/netinet6/in6_pcb.c') diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index e8e7c16..341260a 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -719,9 +719,8 @@ in6_pcbdetach(inp) struct inpcbinfo *ipi = inp->inp_pcbinfo; #ifdef IPSEC - if (sotoinpcb(so) != 0) - key_freeso(so); - ipsec6_delete_pcbpolicy(inp); + if (inp->in6p_sp != NULL) + ipsec6_delete_pcbpolicy(inp); #endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); -- cgit v1.1