iplink: Fix descriptor leak in get_link_kind()
Subsystems (2)
PATCH 1/1 iplink: Fix descriptor leak in get_link_kind()
Found by RASU JSC
Signed-off-by Maks Mishin <[email protected]>
--- ip/iplink.c | 3 +++ 1 file changed, 3 insertions(+)
ip/iplink.c +3 -0
@@ -168,6 +168,9 @@ struct link_util *get_link_kind(const char *id)snprintf (buf,sizeof (buf),"%s_link_util" , id); l =dlsym (dlh, buf); +if (dlh !=NULL ) +dlclose (dlh); +if (l ==NULL )return NULL ;
Signature · 1 line
2.30.2
Quoted 12 lines · On Thu, 8 Feb 2024 00:04:50 +0300 Maks Mishin <[email protected]> wrote:
Found by RASU JSC
Signed-off-by Maks Mishin <[email protected]>--- ip/iplink.c | 3 +++ 1 file changed, 3 insertions(+)ip/iplink.c +0
-0
ip/iplink.c struct link_util *get_link_kind(const char *id) · line 176
Quoted 9 lines
ip/iplink.c +3
-0@@ -168,6 +168,9 @@ struct link_util *get_link_kind(const char *id)snprintf (buf,sizeof (buf),"%s_link_util" , id); l =dlsym (dlh, buf); +if (dlh !=NULL ) +dlclose (dlh); +if (l ==NULL )return NULL ;
NAK this will break the caching of BODY.