From 2569c624db563f3344edbce92336fd28844e7fb0 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 24 Nov 2003 17:20:58 +0000 Subject: [PATCH] Don't free a buffer before we finished reading it --- sys/compat/mach/mach_task.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/compat/mach/mach_task.c b/sys/compat/mach/mach_task.c index 9fb3ef896321..753860e33333 100644 --- a/sys/compat/mach/mach_task.c +++ b/sys/compat/mach/mach_task.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_task.c,v 1.40 2003/11/24 16:51:33 manu Exp $ */ +/* $NetBSD: mach_task.c,v 1.41 2003/11/24 17:20:58 manu Exp $ */ /*- * Copyright (c) 2002-2003 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #include "opt_compat_darwin.h" #include -__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.40 2003/11/24 16:51:33 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.41 2003/11/24 17:20:58 manu Exp $"); #include #include @@ -342,12 +342,13 @@ mach_task_threads(args) free(mnp, M_TEMP); return mach_msg_error(args, error); } - free(mnp, M_TEMP); #ifdef KTRACE if (KTRPOINT(l->l_proc, KTR_MOOL) && error == 0) ktrmool(l->l_proc, mnp, size, (void *)va); #endif + free(mnp, M_TEMP); + rep->rep_msgh.msgh_bits = MACH_MSGH_REPLY_LOCAL_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE) | MACH_MSGH_BITS_COMPLEX;