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...
This commit is contained in:
Brian Feldman 2000-03-22 02:27:30 +00:00
parent ec29d1783a
commit 333aa64d05
2 changed files with 4 additions and 4 deletions

View File

@ -527,7 +527,8 @@ in_pcbdetach(inp)
struct inpcbinfo *ipi = inp->inp_pcbinfo;
#ifdef IPSEC
ipsec4_delete_pcbpolicy(inp);
if (inp->inp_sp != NULL)
ipsec4_delete_pcbpolicy(inp);
#endif /*IPSEC*/
inp->inp_gencnt = ++ipi->ipi_gencnt;
in_pcbremlists(inp);

View File

@ -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);