Date: Wed, 23 Jan 2008 20:01:29 GMT From: Andre Oppermann <andre@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 133940 for review Message-ID: <200801232001.m0NK1TEd080724@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133940 Change 133940 by andre@andre_flirtbox on 2008/01/23 20:00:45 Fix memory leak when length is zero. We must always consume the mbuf. Add commment to note this. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_reass.c#14 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_reass.c#14 (text+ko) ==== @@ -156,6 +156,9 @@ /* * Insert segments into the reassembly queue. + * + * NB: We must always consume the mbuf. Either by appeding it to + * the queue or by freeing it. */ int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) @@ -190,8 +193,10 @@ } /* XXX: should not happen, but does for some reason. */ - if (*tlenp == 0) + if (*tlenp == 0) { + m_freem(m); return (0); + } KASSERT(*tlenp > 0, ("%s: segment doesn't contain any data", __func__));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801232001.m0NK1TEd080724>