aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys/module/exec.c')
-rw-r--r--com32/lib/sys/module/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/com32/lib/sys/module/exec.c b/com32/lib/sys/module/exec.c
index 025864bc..bb855efb 100644
--- a/com32/lib/sys/module/exec.c
+++ b/com32/lib/sys/module/exec.c
@@ -65,6 +65,7 @@ int load_library(const char *name) {
if (res != 0) {
+ module_unload(module);
return res;
}
@@ -106,7 +107,7 @@ int unload_library(const char *name) {
}
int spawnv(const char *name, const char **argv) {
- int res, ret_val;
+ int res, ret_val = 0;
struct elf_module *module = module_alloc(module_get_fullname(name));
@@ -116,6 +117,7 @@ int spawnv(const char *name, const char **argv) {
res = module_load(module);
if (res != 0) {
+ module_unload(module);
return res;
}