From c48925b5ebba1767b80803bb51b2abf4836a0660 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Mon, 3 Jul 2023 12:26:26 -0600 Subject: [PATCH] samples: Fix coverity warning in systemd C example Fix the following coverity warning in the systemd C example: CID 1516633 (#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 cb77d9b7..cb9ab7d4 100644 --- a/samples/c/create_systemd_scope.c +++ b/samples/c/create_systemd_scope.c @@ -461,10 +461,10 @@ error: static int delete_tmp_cgroup(void) { + struct cgroup *cg = NULL; int ret, pid_cnt, i; int saved_errno = 0; pid_t *pids = NULL; - struct cgroup *cg; ret = cgroup_get_procs(TMP_CGNAME, NULL, &pids, &pid_cnt); if (ret) { -- 2.47.2