aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys/module/common.c')
-rw-r--r--com32/lib/sys/module/common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index 7c588ef7..8a685130 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -335,10 +335,12 @@ int module_unload(struct elf_module *module) {
list_del_init(&module->list);
// Release the loaded segments or sections
- elf_free(module->module_addr);
+ if (module->module_addr != NULL) {
+ elf_free(module->module_addr);
- DBG_PRINT("%s MODULE %s UNLOADED\n", module->shallow ? "SHALLOW" : "",
- module->name);
+ DBG_PRINT("%s MODULE %s UNLOADED\n", module->shallow ? "SHALLOW" : "",
+ module->name);
+ }
// Release the module structure
free(module);