diff mbox series

m_action: Fix descriptor leak in get_action_kind()

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

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

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

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

Comments

Stephen Hemminger Feb. 8, 2024, 5:05 p.m. UTC | #1
On Thu,  8 Feb 2024 00:16:32 +0300
Maks Mishin <maks.mishinfz@gmail.com> wrote:

> Found by RASU JSC
> 
> Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
> ---
>  tc/m_action.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tc/m_action.c b/tc/m_action.c
> index 16474c56..7d18f7fa 100644
> --- a/tc/m_action.c
> +++ b/tc/m_action.c
> @@ -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
diff mbox series

Patch

diff --git a/tc/m_action.c b/tc/m_action.c
index 16474c56..7d18f7fa 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -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;