From 6bc5b7041bc2a7802f762138705deca9c537d1ff Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 10 Mar 2011 16:19:56 +0100 Subject: Fix NULL-free bug in hibernate on debug emulator --- erts/emulator/hipe/hipe_mode_switch.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'erts') 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) -- cgit v1.2.3