diff options
author | andre <andre@FreeBSD.org> | 2006-01-18 18:25:03 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2006-01-18 18:25:03 +0000 |
commit | b43ff067878153b71dafe80eb6e1d5ffdcad3fd0 (patch) | |
tree | dd2fd5f55f17d1e806fc1e03090240aefa8c77ef /sys/netinet/tcp_syncache.c | |
parent | 59fe0d8fe886d4784ee2d673577bc1779316033e (diff) | |
download | FreeBSD-src-b43ff067878153b71dafe80eb6e1d5ffdcad3fd0.zip FreeBSD-src-b43ff067878153b71dafe80eb6e1d5ffdcad3fd0.tar.gz |
In syncache_expand() insert a proper syncache_free() to fix a case
that currently can't be triggered. But better be safe than sorry
later on. Additionally it properly silences Coverity Prevent for
future tests.
Found by: Coverity Prevent(tm)
Coverity ID: CID802
Sponsored by: TCP/IP Optimization Fundraise 2005
MFC after: 3 days
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 13f7320..96ad866 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -767,8 +767,11 @@ syncache_expand(inc, th, sop, m) /* * If seg contains an ACK, but not for our SYN/ACK, send a RST. */ - if (th->th_ack != sc->sc_iss + 1) + if (th->th_ack != sc->sc_iss + 1) { + if (sch == NULL) + syncache_free(sc); return (0); + } so = syncache_socket(sc, *sop, m); if (so == NULL) { |