Skip to contentSkip to conversation

m_ematch: Fix descriptor leak in get_ematch_kind()

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

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

PATCH 1/1 m_ematch: Fix descriptor leak in get_ematch_kind()

Found by RASU JSC

---
 tc/m_ematch.c | 3 +++
 1 file changed, 3 insertions(+)
tc/m_ematch.c +3 -0
index fefc7860..eef6b05d 100644
@@ -149,6 +149,9 @@ static struct ematch_util *get_ematch_kind(char *kind)
 
 	snprintf(buf, sizeof(buf), "%s_ematch_util", kind);
 	e = dlsym(dlh, buf);
+	if (dlh != NULL)
+		dlclose(dlh);
+
 	if (e == NULL)
 		return NULL;
 
Signature · 1 line
2.30.2