diff mbox series

tc_exec: Fix descriptor leak in get_exec_kind()

Message ID 20240207214242.19291-1-maks.mishinFZ@gmail.com (mailing list archive)
State Rejected
Delegated to: Stephen Hemminger
Headers show
Series tc_exec: Fix descriptor leak in get_exec_kind() | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Maks Mishin Feb. 7, 2024, 9:42 p.m. UTC
Found by RASU JSC

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
---
 tc/tc_exec.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tc/tc_exec.c b/tc/tc_exec.c
index 182fbb4c..ae9e1f94 100644
--- a/tc/tc_exec.c
+++ b/tc/tc_exec.c
@@ -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: