tc: Fix descriptor leak in get_filter_kind()
Subsystems (2)
PATCH 1/1 tc: Fix descriptor leak in get_filter_kind()
Add closure of fd dlh.
Found by RASU JSC
Signed-off-by Maks Mishin <[email protected]>
--- tc/tc.c | 3 +++ 1 file changed, 3 insertions(+)
tc/tc.c +3 -0
@@ -167,6 +167,9 @@ struct filter_util *get_filter_kind(const char *str)snprintf (buf,sizeof (buf),"%s_filter_util" , str); q =dlsym (dlh, buf); +if (dlh !=NULL ) +dlclose (dlh); +if (q ==NULL ) goto noexist;
Signature · 1 line
2.30.2