Fix the following coverity warning in the systemd C example:
CID
1516634 (#1 of 1): Uninitialized pointer read (UNINIT)5.
uninit_use: Using uninitialized value cg.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
static int move_pids_to_tmp_cgroup(const struct example_opts * const opts)
{
+ struct cgroup *cg = NULL;
int ret, pid_cnt, i;
pid_t *pids = NULL;
int saved_ret = 0;
- struct cgroup *cg;
/*
* Since we told libcgroup that our slice and scope are the default, we can