]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: fix coverity warning about uninitialized variable
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 27 May 2022 20:58:13 +0000 (14:58 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 27 May 2022 20:58:16 +0000 (14:58 -0600)
commite61a3ca6561068ccd31bb816477a8936a4b021e0
treeaa11e8b349b139034857ccf02ad8e4633f51ef65
parent5d281251a8e7ddc9a1dc0a13c8d03c5827c42a13
api: fix coverity warning about uninitialized variable

CID 258269 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use: Using uninitialized value version.

In _cgroup_create_cgroup(), the (cg_version_t)version is uninitialized
and might be read the version in false path. It worked until now
because the version is assigned in the true path and given that its enum
the checks are not bounded by range, but rather specific.

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