]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools-common.c: Fix resource leak in cgroup_string_list_add_directory()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 29 Jan 2025 09:49:12 +0000 (15:19 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 31 Jan 2025 20:59:57 +0000 (13:59 -0700)
commitd0c4cfd7ffe86feeb179a7efc4161401cdc9de82
tree22b0b60b6f984c78826b40405ef4edd8b59c617a
parentb4bc68c302acdb44540e521093bd47b5d48688f8
tools-common.c: Fix resource leak in cgroup_string_list_add_directory()

Fix a Coverity warning about resource leak:

CID 465889: (#4 of 4): Resource leak (RESOURCE_LEAK)
32. leaked_storage: Variable fullpath going out of scope leaks the
storage it points to.

Fix it by releasing the 'fullpath', when file name does not matches
'*.conf' code path(s).

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/tools-common.c