Date: Sat, 10 Aug 2002 13:19:47 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: FUJITA Kazutoshi <fujita@soum.co.jp> Cc: freebsd-net@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: m_freem() in tcp_respond() Message-ID: <3D557563.D1FC72B8@mindspring.com> References: <20020811.040808.74720123.fujita@soum.co.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
FUJITA Kazutoshi wrote: > --- /sys/netinet/tcp_subr.c.ORG Thu Jul 18 19:47:04 2002 > +++ /sys/netinet/tcp_subr.c Sun Aug 11 04:00:09 2002 > @@ -393,7 +393,8 @@ > bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr)); > flags = TH_ACK; > } else { > - m_freem(m->m_next); > + if (m->m_next) > + m_freem(m->m_next); > m->m_next = 0; > m->m_data = (caddr_t)ipgen; > /* m_len is set later */ NO. It is better to know that it's not NULL before it gets there. If you check everything everywhere to see if it's NULL before you do anything, then you are going to speen all your time comparing things to NULL, rather than doing real work. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D557563.D1FC72B8>