Make sure to init moduleInfoPtr

This commit is contained in:
Maschell 2024-04-21 18:19:58 +02:00
parent 35b8c0eeb7
commit b5f62f552d
1 changed files with 1 additions and 0 deletions

View File

@ -366,6 +366,7 @@ void LoadAndRunModule(std::string_view filepath, std::string_view environment_pa
auto moduleInfo = std::move(*moduleInfoOpt);
auto moduleInfoPtr = (module_information_t *) moduleInfo.data();
*moduleInfoPtr = {};
// Frees automatically, must not survive the heapWrapper.
auto moduleData = ModuleDataFactory::load(reader, *heapWrapperOpt, moduleInfoPtr->trampolines, sizeof(moduleInfoPtr->trampolines) / sizeof(moduleInfoPtr->trampolines[0]));