From 33a687525266e771e6a1afc5c06e03b89bc193cf Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Mon, 3 Jul 2023 12:24:56 -0600 Subject: [PATCH] samples: Fix coverity warning in systemd C example 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 Reviewed-by: Kamalesh Babulal --- samples/c/create_systemd_scope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/c/create_systemd_scope.c b/samples/c/create_systemd_scope.c index 2273d293..cb77d9b7 100644 --- a/samples/c/create_systemd_scope.c +++ b/samples/c/create_systemd_scope.c @@ -209,10 +209,10 @@ error: 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 -- 2.47.2