Skip to contentSkip to conversation

m_pedit: Fix descriptor leak in get_pedit_kind()

PATCH In review Maks Mishin 2 participants 2 messages Feb 7, 2024 – Feb 8, 2024

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

PATCH 1/1 m_pedit: Fix descriptor leak in get_pedit_kind()

Found by RASU JSC

---
 tc/m_pedit.c | 3 +++
 1 file changed, 3 insertions(+)
tc/m_pedit.c +3 -0
index 32f03415..b5965250 100644
@@ -95,6 +95,9 @@ static struct m_pedit_util *get_pedit_kind(const char *str)
 
 	snprintf(buf, sizeof(buf), "p_pedit_%s", str);
 	p = dlsym(dlh, buf);
+	if (dlh != NULL)
+		dlclose(dlh);
+
 	if (p == NULL)
 		goto noexist;
 
Signature · 1 line
2.30.2