Skip to contentSkip to conversation

tc_exec: Fix descriptor leak in get_exec_kind()

PATCH New Maks Mishin 1 participant 1 message Feb 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tc_exec: Fix descriptor leak in get_exec_kind()

Found by RASU JSC

---
 tc/tc_exec.c | 3 +++
 1 file changed, 3 insertions(+)
tc/tc_exec.c +3 -0
index 182fbb4c..ae9e1f94 100644
@@ -60,6 +60,9 @@ static struct exec_util *get_exec_kind(const char *name)
 
 	snprintf(buf, sizeof(buf), "%s_exec_util", name);
 	eu = dlsym(dlh, buf);
+	if (dlh != NULL)
+		dlclose(dlh);
+
 	if (eu == NULL)
 		goto noexist;
 reg:
Signature · 1 line
2.30.2