From bcdd2cb33797412cce1f1014d265a71461676cff Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 24 Aug 2022 16:35:51 +0200 Subject: examples: add module search path initialization and freeing Since commit 3c168b5 ("vm, cli: move search path into global config...") it is required to explicitly initialize the module search path in the configuration structure for compile time module imports and run time require operations to work. Signed-off-by: Jo-Philipp Wich --- examples/exception-handler.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/exception-handler.c') diff --git a/examples/exception-handler.c b/examples/exception-handler.c index 324a350..290518a 100644 --- a/examples/exception-handler.c +++ b/examples/exception-handler.c @@ -74,6 +74,9 @@ int main(int argc, char **argv) return 1; } + /* initialize default module search path */ + uc_search_path_init(&config.module_search_path); + /* initialize VM context */ uc_vm_t vm = { 0 }; uc_vm_init(&vm, &config); @@ -96,5 +99,8 @@ int main(int argc, char **argv) /* free VM context */ uc_vm_free(&vm); + /* free search module path vector */ + uc_search_path_free(&config.module_search_path); + return exit_code; } -- cgit v1.2.3