Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_map: don't leak a preallocated map entry on error.



details:   https://anonhg.NetBSD.org/src/rev/2fe5ab087ad7
branches:  trunk
changeset: 580537:2fe5ab087ad7
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu Apr 28 14:40:43 2005 +0000

description:
uvm_map: don't leak a preallocated map entry on error.

diffstat:

 sys/uvm/uvm_map.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 7a541afcf9c0 -r 2fe5ab087ad7 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Thu Apr 28 12:47:45 2005 +0000
+++ b/sys/uvm/uvm_map.c Thu Apr 28 14:40:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.188 2005/04/07 06:44:15 dbj Exp $        */
+/*     $NetBSD: uvm_map.c,v 1.189 2005/04/28 14:40:43 yamt Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.188 2005/04/07 06:44:15 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.189 2005/04/28 14:40:43 yamt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -804,6 +804,8 @@
        if (!error) {
                error = uvm_map_enter(map, &args, new_entry);
                *startp = args.uma_start;
+       } else if (new_entry) {
+               uvm_mapent_free(new_entry);
        }
 
 #if defined(DEBUG)



Home | Main Index | Thread Index | Old Index