Subject: CVS commit: [netbsd-2-0] src/sys/kern
To: None <source-changes@NetBSD.org>
From: Matthias Scheler <tron@netbsd.org>
List: source-changes
Date: 06/16/2004 18:10:33
Module Name:	src
Committed By:	tron
Date:		Wed Jun 16 18:10:33 UTC 2004

Modified Files:
	src/sys/kern [netbsd-2-0]: uipc_socket2.c

Log Message:
Pull up revision 1.64 (requested by jonathan in ticket #503):
Fix potential memory leak in sbappendaddrchain():
We do an MGETHDR)() for each mbuf "packet" of the input chain, to hold
the socket address prepended to that "packet".  If those MGETHDR()s
ever failed, we would leak all the successfully-allocated mbuf
headers.  Leak noted by Yamamoto-san (yamt@NetBSD.org); thanks for catching it!
Add socketbuf invariant-checking macros to sbappendaddrchain(), and
replace a stray bcopy() with memcpy(), also as suggested by Yamamoto-san.


To generate a diff of this commit:
cvs rdiff -r1.58.2.1 -r1.58.2.2 src/sys/kern/uipc_socket2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.