mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 14:14:56 +00:00
tcp: improve error handling in syncache_socket()
If syncache_socket() fails after calling tcp_newtcpcb(), the resources allocated in tcp_newtcpcb() needs to be freed. Just call tcp_discardcb() to do this. Thanks to jtl for making me aware of the issue and proposing a fix. Reviewed by: glebius, jtl, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45749
This commit is contained in:
parent
18a27dd641
commit
3703e1a73e
|
@ -1053,6 +1053,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
abort:
|
abort:
|
||||||
|
tcp_discardcb(tp);
|
||||||
in_pcbfree(inp);
|
in_pcbfree(inp);
|
||||||
sodealloc(so);
|
sodealloc(so);
|
||||||
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
|
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
|
||||||
|
|
Loading…
Reference in a new issue