From bac6b11065c90de881c1e9cc8ad341d64a1ba225 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 25 Feb 2021 13:53:20 +0900 Subject: [PATCH] sched/module/mod_insmod.c: Fix a resource leak Note: partially initialized loadinfo should be uninitialized. It can contain an open file descriptor. --- sched/module/mod_insmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index 6e062f35b9..b94d080e2c 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -185,7 +185,7 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname) if (ret != 0) { berr("ERROR: Failed to initialize to load module: %d\n", ret); - goto errout_with_lock; + goto errout_with_loadinfo; } /* Allocate a module registry entry to hold the module data */