invalidate input mbuf as soon as it is consumed by the mbuf chain
to avoid a double free later.
This commit is contained in:
parent
3af45c0517
commit
b8751ed3e7
@ -44,7 +44,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
/* __FBSDID("FreeBSD: head/sys/nfs/krpc_subr.c 248207 2013-03-12 13:42:47Z glebius "); */
|
||||
__RCSID("$NetBSD: krpc_subr.c,v 1.2 2015/02/07 04:06:52 christos Exp $");
|
||||
__RCSID("$NetBSD: krpc_subr.c,v 1.3 2015/02/07 12:50:25 mlelstv Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -279,6 +279,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func,
|
||||
*/
|
||||
mhead = m_gethdr(M_WAITOK, MT_DATA);
|
||||
mhead->m_next = *data;
|
||||
*data = NULL;
|
||||
call = mtod(mhead, struct krpc_call *);
|
||||
mhead->m_len = sizeof(*call);
|
||||
bzero((caddr_t)call, sizeof(*call));
|
||||
|
Loading…
x
Reference in New Issue
Block a user