Skip to contentSkip to conversation

m_action: Fix descriptor leak in get_action_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_action: Fix descriptor leak in get_action_kind()

Found by RASU JSC

---
 tc/m_action.c | 3 +++
 1 file changed, 3 insertions(+)
tc/m_action.c +3 -0
index 16474c56..7d18f7fa 100644
@@ -111,6 +111,9 @@ restart_s:
 
 	snprintf(buf, sizeof(buf), "%s_action_util", str);
 	a = dlsym(dlh, buf);
+	if (dlh != NULL)
+		dlclose(dlh);
+
 	if (a == NULL)
 		goto noexist;
 
Signature · 1 line
2.30.2
#1 lore raw
Quoted 12 lines · On Thu, 8 Feb 2024 00:16:32 +0300 Maks Mishin <[email protected]> wrote:

Found by RASU JSC

---
 tc/m_action.c | 3 +++
 1 file changed, 3 insertions(+)
tc/m_action.c +0 -0
index 16474c56..7d18f7fa 100644

tc/m_action.c restart_s: · line 119

Quoted 9 lines
tc/m_action.c +3 -0
@@ -111,6 +111,9 @@ restart_s:
 
 	snprintf(buf, sizeof(buf), "%s_action_util", str);
 	a = dlsym(dlh, buf);
+	if (dlh != NULL)
+		dlclose(dlh);
+
 	if (a == NULL)
 		goto noexist;
 

NAK again, this will break the caching