Task #18183 - fixed.err

back to task #18183
download
Error: GCC_ANALYZER_WARNING (CWE-775):
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-resources.c:1131:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_htlb, 2686976)'
# 1129|         if (UNLIKELY (ret < 0))
# 1130|           return ret;
# 1131|->       dirfd_htlb = open (path_to_htlb, O_DIRECTORY | O_PATH | O_CLOEXEC);
# 1132|         if (UNLIKELY (dirfd_htlb < 0))
# 1133|           return crun_make_error (err, errno, "open `%s`", path_to_htlb);

Error: GCC_ANALYZER_WARNING (CWE-775):
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-resources.c:1150:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_devs, 589824)'
# 1148|           return ret;
# 1149|   
# 1150|->       dirfd_devs = open (path_to_devs, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1151|         if (UNLIKELY (dirfd_devs < 0))
# 1152|           return crun_make_error (err, errno, "open `%s`", path_to_devs);

Error: GCC_ANALYZER_WARNING (CWE-688):
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'get_cgroup_scope_path'
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c:1685:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c:23: included_from: Included from here.
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 1683|     path_to_scope = xstrdup (cgroup_path);
# 1684|   
# 1685|->   cur = strchr (path_to_scope, '/');
# 1686|     while (cur)
# 1687|       {

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'libcrun_destroy_cgroup_systemd'
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c:1686:10: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 1684|   
# 1685|     cur = strchr (path_to_scope, '/');
# 1686|->   while (cur)
# 1687|       {
# 1688|         char *next = strchr (cur + 1, '/');

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-1.17-build/crun-HEAD/src/libcrun/cgroup-systemd.c:1688:32: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 1686|     while (cur)
# 1687|       {
# 1688|->       char *next = strchr (cur + 1, '/');
# 1689|         if (next == NULL)
# 1690|           break;

Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_htlb'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  103|     int *pp = (int *) p;
#  104|     if (*pp >= 0)
#  105|->     TEMP_FAILURE_RETRY (close (*pp));
#  106|   }
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netclass'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  103|     int *pp = (int *) p;
#  104|     if (*pp >= 0)
#  105|->     TEMP_FAILURE_RETRY (close (*pp));
#  106|   }
#  107|   

Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netprio'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  103|     int *pp = (int *) p;
#  104|     if (*pp >= 0)
#  105|->     TEMP_FAILURE_RETRY (close (*pp));
#  106|   }
#  107|