Skip to content

Commit 6e7d9ba

Browse files
committed
Merge pull request #1657 from pguyot/w19/fix-load-module-failure
Fix crash when loading module fails, for example because of OOM These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 332dd24 + 76cc2dc commit 6e7d9ba

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/libAtomVM/globalcontext.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,7 @@ Module *globalcontext_load_module_from_avm(GlobalContext *global, const char *mo
687687
return NULL;
688688
}
689689

690-
Module *new_module = module_new_from_iff_binary(global, beam_module, beam_module_size);
691-
new_module->module_platform_data = NULL;
692-
693-
return new_module;
690+
return module_new_from_iff_binary(global, beam_module, beam_module_size);
694691
}
695692

696693
Module *globalcontext_get_module(GlobalContext *global, AtomString module_name_atom)

0 commit comments

Comments
 (0)