aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-17 11:24:21 +0100
committerBjörn Gustavsson <[email protected]>2011-11-26 07:31:15 +0100
commitebb280b7c02165cf819131cc0026d9b509560fa6 (patch)
tree160730bf7dd9eeb33dced4e067574f820702be0a /erts/emulator/beam/beam_load.c
parentf545894e96d5898285eee8dce812c885cf208fb7 (diff)
downloadotp-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/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c4
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);
}