Task #39839 - added.err
back to task #39839download
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'read_pids_cgroup'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:308:13: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(dfd)'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'read_pids_cgroup'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'read_pids_cgroup'
# 306| struct dirent *de;
# 307|
# 308|-> dir = fdopendir (dfd);
# 309| if (UNLIKELY (dir == NULL))
# 310| return crun_make_error (err, errno, "open cgroup sub-directory");
Error: GCC_ANALYZER_WARNING (CWE-775):
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_cgroup_read_pids_from_path'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:444:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 589824)'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_cgroup_read_pids_from_path'
# 442| }
# 443|
# 444|-> dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 445| if (dirfd < 0)
# 446| return crun_make_error (err, errno, "open `%s`", cgroup_path);
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:23: included_from: Included from here.
crun-1.20-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'read_pids_cgroup'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:83:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(*pids, (*n_pids + n_new_pids + 1) * 4)'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-1.20-build/crun-HEAD/src/libcrun/container.h:24: included_from: Included from here.
crun-1.20-build/crun-HEAD/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:22: included_from: Included from here.
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:646:12: note: in expansion of macro 'crun_make_error'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'read_pids_cgroup'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'read_pids_cgroup'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
# 81| {
# 82| void *res = realloc (ptr, size);
# 83|-> if (UNLIKELY (res == NULL))
# 84| OOM ();
# 85| return res;
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'tasksfd'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 106| int *pp = (int *) p;
# 107| if (*pp >= 0)
# 108|-> TEMP_FAILURE_RETRY (close (*pp));
# 109| }
# 110|
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-1.20-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:210:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*fd'
# 208| if (*fd >= 0)
# 209| {
# 210|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 211| if (LIKELY (ret == 0))
# 212| *fd = -1;