]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: add ret value check in cgroup_get_current_controller_path()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 23 Jun 2023 06:19:04 +0000 (11:49 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 23 Jun 2023 13:46:42 +0000 (07:46 -0600)
commit9be563218aba0de080cd4beefb46beec8d620d5d
treec9eccd611e8fba78e710e47b1f09a58ca9c82e02
parentf740b9bf8898b25992c5b9acbb880e1e78a665b6
api: add ret value check in cgroup_get_current_controller_path()

Fix unchecked return value, reported by the Coverity tool:

CID 320874 (#1 of 1): Unchecked return value from library
(CHECKED_RETURN)13. check_return: Calling fscanf(pid_cgroup_fd,
"%*[^\n]\n") without checking return value. This library function may
fail and return an error code.

add the missing return value check from fscanf() in
cgroup_get_current_controller_path()

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