aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-05-17 12:19:38 +0200
committerGitHub <[email protected]>2018-05-17 12:19:38 +0200
commit759af43a8213f6c0b39a76ae062a89b726cd4c25 (patch)
tree949a150dc6f6decf59c81eb68bf345dfd16f6b45 /erts/emulator/beam/erl_nif.c
parentdaf8172b510c319fab74f77e438eae3518812543 (diff)
parentd7bacbc798d608f259eb2faaaf194cb9df323018 (diff)
downloadotp-759af43a8213f6c0b39a76ae062a89b726cd4c25.tar.gz
otp-759af43a8213f6c0b39a76ae062a89b726cd4c25.tar.bz2
otp-759af43a8213f6c0b39a76ae062a89b726cd4c25.zip
Merge PR-1819 from sverker/enif_binary_to_term-bug/OTP-15080
Fix bug in enif_binary_to_term for immediates
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index e208792868..0fbf0eb03a 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1255,8 +1255,10 @@ size_t enif_binary_to_term(ErlNifEnv *dst_env,
if (is_non_value(*term)) {
return 0;
}
- erts_factory_close(&factory);
- cache_env(dst_env);
+ if (size > 0) {
+ erts_factory_close(&factory);
+ cache_env(dst_env);
+ }
ASSERT(bp > data);
return bp - data;