Task #40018 - fixed.err

back to task #40018
download
Error: GCC_ANALYZER_WARNING (CWE-775):
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c:968:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cgroup, 2818048)'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
#  966|       return ret;
#  967|   
#  968|->   cgroupdirfd = open (path_to_cgroup, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_PATH);
#  969|     if (UNLIKELY (cgroupdirfd < 0))
#  970|       return crun_make_error (err, errno, "open `%s`", path_to_cgroup);

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 'write_controller_file'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:65:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(controllers_len + 1)'
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/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-415):
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&cgroup_path_type'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415):
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&content'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-1.20-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.20-build/crun-HEAD/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(t)'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|