diff options
author | Björn Gustavsson <[email protected]> | 2011-11-17 11:24:21 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-11-26 07:31:15 +0100 |
commit | ebb280b7c02165cf819131cc0026d9b509560fa6 (patch) | |
tree | 160730bf7dd9eeb33dced4e067574f820702be0a /erts | |
parent | f545894e96d5898285eee8dce812c885cf208fb7 (diff) | |
download | otp-ebb280b7c02165cf819131cc0026d9b509560fa6.tar.gz otp-ebb280b7c02165cf819131cc0026d9b509560fa6.tar.bz2 otp-ebb280b7c02165cf819131cc0026d9b509560fa6.zip |
beam_load.c: Eliminate memory leak in code:make_stub_module/3
code:make_stub_module/3 leaked memory if given either a corrupt
BEAM file, or a compressed BEAM file and an error occurred, or
a binary not aligned on byte boundaries.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 4427defe0c..93eae4dee8 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -5993,6 +5993,10 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info) } error: + erts_free_aligned_binary_bytes(temp_alloc); + if (bin) { + driver_free_binary(bin); + } free_state(stp); BIF_ERROR(p, BADARG); } |