summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-10-24 06:34:55 +0000
committerderaadt <deraadt@openbsd.org>2008-10-24 06:34:55 +0000
commitf9b40c8afafc9a47c301958a2788ac0941ff150b (patch)
treecf103df515d4220f0810268ec16e1d0997270323
parentit is a good policy to clear the pointer after we free something (diff)
downloadwireguard-openbsd-f9b40c8afafc9a47c301958a2788ac0941ff150b.tar.xz
wireguard-openbsd-f9b40c8afafc9a47c301958a2788ac0941ff150b.zip
clear pointer after freeing it
-rw-r--r--sys/arch/i386/i386/pmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index 44d6bc3c41c..45a159221ff 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.123 2008/06/14 18:09:47 hshoexer Exp $ */
+/* $OpenBSD: pmap.c,v 1.124 2008/10/24 06:34:55 deraadt Exp $ */
/* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */
/*
@@ -1547,6 +1547,7 @@ pmap_release(struct pmap *pmap)
* APTE space because we do that in pmap_unmap_ptes().
*/
uvm_km_free(kernel_map, (vaddr_t)pmap->pm_pdir, NBPG);
+ pmap->pm_pdir = NULL;
#ifdef USER_LDT
if (pmap->pm_flags & PMF_USER_LDT) {