aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-03-10 16:19:56 +0100
committerSverker Eriksson <[email protected]>2011-03-10 16:44:41 +0100
commit6bc5b7041bc2a7802f762138705deca9c537d1ff (patch)
tree85be03f37dfee48d1c299afb13666d3a8b78241d
parentce00ecb42c136b55d91ece38c9cf29b0d0cc6380 (diff)
downloadotp-6bc5b7041bc2a7802f762138705deca9c537d1ff.tar.gz
otp-6bc5b7041bc2a7802f762138705deca9c537d1ff.tar.bz2
otp-6bc5b7041bc2a7802f762138705deca9c537d1ff.zip
Fix NULL-free bug in hibernate on debug emulator
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index e2417b38c5..53ebcd4008 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2011. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -607,11 +607,13 @@ void hipe_inc_nstack(Process *p)
void hipe_empty_nstack(Process *p)
{
- erts_free(ERTS_ALC_T_HIPE, p->hipe.nstack);
- p->hipe.nstgraylim = NULL;
- p->hipe.nsp = NULL;
- p->hipe.nstack = NULL;
- p->hipe.nstend = NULL;
+ if (p->hipe.nstack) {
+ erts_free(ERTS_ALC_T_HIPE, p->hipe.nstack);
+ }
+ p->hipe.nstgraylim = NULL;
+ p->hipe.nsp = NULL;
+ p->hipe.nstack = NULL;
+ p->hipe.nstend = NULL;
}
static void hipe_check_nstack(Process *p, unsigned nwords)