Subject: CVS commit: src/sys/kern
To: None <source-changes@NetBSD.org>
From: Jonathan Stone <jonathan@netbsd.org>
List: source-changes
Date: 06/11/2004 03:46:01
Module Name: src
Committed By: jonathan
Date: Fri Jun 11 03:46:01 UTC 2004
Modified Files:
src/sys/kern: uipc_socket2.c
Log Message:
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.63 -r1.64 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.