Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/mach Don't free a buffer before we finished readi...



details:   https://anonhg.NetBSD.org/src/rev/c5b4747815bf
branches:  trunk
changeset: 555662:c5b4747815bf
user:      manu <manu%NetBSD.org@localhost>
date:      Mon Nov 24 17:20:58 2003 +0000

description:
Don't free a buffer before we finished reading it

diffstat:

 sys/compat/mach/mach_task.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 61c27ea1f13f -r c5b4747815bf sys/compat/mach/mach_task.c
--- a/sys/compat/mach/mach_task.c       Mon Nov 24 16:53:38 2003 +0000
+++ b/sys/compat/mach/mach_task.c       Mon Nov 24 17:20:58 2003 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/types.h>
 #include <sys/param.h>
@@ -342,12 +342,13 @@
                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;



Home | Main Index | Thread Index | Old Index