diff options
author | Sverker Eriksson <[email protected]> | 2017-02-03 15:22:48 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-02-03 17:23:35 +0100 |
commit | 3fe6f3c0caecec522c7e14353eda6bbb86c9e8d6 (patch) | |
tree | 29710e0dcc08a4798d61027f2f7762a0fc275ad8 /erts/emulator/beam/erl_db_util.c | |
parent | 69b928b12d9206d00879c08e46143f599f9dc34e (diff) | |
download | otp-3fe6f3c0caecec522c7e14353eda6bbb86c9e8d6.tar.gz otp-3fe6f3c0caecec522c7e14353eda6bbb86c9e8d6.tar.bz2 otp-3fe6f3c0caecec522c7e14353eda6bbb86c9e8d6.zip |
erts: Add deallocation veto for magic destructors
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r-- | erts/emulator/beam/erl_db_util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 4e987d5bee..991d63a18b 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1702,17 +1702,18 @@ error: /* Here is were we land when compilation failed. */ /* ** Free a match program (in a binary) */ -void erts_db_match_prog_destructor(Binary *bprog) +int erts_db_match_prog_destructor(Binary *bprog) { MatchProg *prog; if (bprog == NULL) - return; + return 1; prog = Binary2MatchProg(bprog); if (prog->term_save != NULL) { free_message_buffer(prog->term_save); } if (prog->saved_program_buf != NULL) free_message_buffer(prog->saved_program_buf); + return 1; } void |