aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/legacy/erl_fix_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/src/legacy/erl_fix_alloc.c')
-rw-r--r--lib/erl_interface/src/legacy/erl_fix_alloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/erl_interface/src/legacy/erl_fix_alloc.c b/lib/erl_interface/src/legacy/erl_fix_alloc.c
index 20f3024e41..2ed0dd1470 100644
--- a/lib/erl_interface/src/legacy/erl_fix_alloc.c
+++ b/lib/erl_interface/src/legacy/erl_fix_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-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
@@ -109,6 +109,10 @@ void *erl_eterm_alloc (void)
erl_eterm_state->freed--;
} else if ((b = malloc(sizeof(*b))) == NULL) {
erl_errno = ENOMEM;
+#ifdef _REENTRANT
+ ei_mutex_unlock(erl_eterm_state->lock);
+#endif /* _REENTRANT */
+ return NULL;
}
erl_eterm_state->allocated++;
b->free = 0;