diff options
author | Christian von Roques <[email protected]> | 2011-08-08 16:33:05 +0200 |
---|---|---|
committer | Christian von Roques <[email protected]> | 2011-09-06 20:06:45 +0200 |
commit | ef757a19bdab06e29dcc29de32ef7b8202f2e68d (patch) | |
tree | 5bc7e8ed5c3cbca7d7a4bfc37430d5af833aeee8 /lib/erl_interface/src/legacy | |
parent | 22dae863060e0d66fa268f6d1cd4d6f084b850ab (diff) | |
download | otp-ef757a19bdab06e29dcc29de32ef7b8202f2e68d.tar.gz otp-ef757a19bdab06e29dcc29de32ef7b8202f2e68d.tar.bz2 otp-ef757a19bdab06e29dcc29de32ef7b8202f2e68d.zip |
Changes inspired by running cppcheck(1)
Diffstat (limited to 'lib/erl_interface/src/legacy')
-rw-r--r-- | lib/erl_interface/src/legacy/erl_fix_alloc.c | 4 |
1 files changed, 4 insertions, 0 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..ca09fc3b8b 100644 --- a/lib/erl_interface/src/legacy/erl_fix_alloc.c +++ b/lib/erl_interface/src/legacy/erl_fix_alloc.c @@ -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; |