diff options
author | Sverker Eriksson <[email protected]> | 2011-03-10 16:19:56 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-03-10 16:44:41 +0100 |
commit | 6bc5b7041bc2a7802f762138705deca9c537d1ff (patch) | |
tree | 85be03f37dfee48d1c299afb13666d3a8b78241d /erts/emulator/hipe/hipe_mode_switch.c | |
parent | ce00ecb42c136b55d91ece38c9cf29b0d0cc6380 (diff) | |
download | otp-6bc5b7041bc2a7802f762138705deca9c537d1ff.tar.gz otp-6bc5b7041bc2a7802f762138705deca9c537d1ff.tar.bz2 otp-6bc5b7041bc2a7802f762138705deca9c537d1ff.zip |
Fix NULL-free bug in hibernate on debug emulator
Diffstat (limited to 'erts/emulator/hipe/hipe_mode_switch.c')
-rw-r--r-- | erts/emulator/hipe/hipe_mode_switch.c | 14 |
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) |