mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 21:32:58 +00:00
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:
parent
ec29d1783a
commit
333aa64d05
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58452
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user