Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(256)'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#   60|   {
#   61|     void *res = malloc (size);
#   62|->   if (UNLIKELY (res == NULL))
#   63|       OOM ();
#   64|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
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.
crun-1.17-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(name_len + 2)'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#   60|   {
#   61|     void *res = malloc (size);
#   62|->   if (UNLIKELY (res == NULL))
#   63|       OOM ();
#   64|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(value + 1)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-1.17-build/crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation'
crun-1.17-build/crun-HEAD/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(value)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Scan Properties

analyzer-version-clippy1.81.0
analyzer-version-cppcheck2.15.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer14.2.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.81.0
diffbase-analyzer-version-cppcheck2.15.0
diffbase-analyzer-version-gcc14.2.1
diffbase-analyzer-version-gcc-analyzer14.2.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-29.us-west-2.compute.internal
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.17-1.20241015143948489372.pr1574.33.g0efbaa7
diffbase-store-results-to/tmp/tmpcoh9ec58/crun-1.17-1.20241015143948489372.pr1574.33.g0efbaa7.tar.xz
diffbase-time-created2024-10-15 14:49:38
diffbase-time-finished2024-10-15 14:55:05
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,cppcheck,shellcheck,unicontrol' '-o' '/tmp/tmpcoh9ec58/crun-1.17-1.20241015143948489372.pr1574.33.g0efbaa7.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmpcoh9ec58/crun-1.17-1.20241015143948489372.pr1574.33.g0efbaa7.src.rpm'
diffbase-tool-versioncsmock-3.7.1-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-29.us-west-2.compute.internal
mock-configfedora-rawhide-x86_64
project-namecrun-1.17-1.20241014095439306722.main.20.g53cd1c1
store-results-to/tmp/tmpgl7hwtgq/crun-1.17-1.20241014095439306722.main.20.g53cd1c1.tar.xz
time-created2024-10-15 14:43:25
time-finished2024-10-15 14:49:15
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,cppcheck,shellcheck,unicontrol' '-o' '/tmp/tmpgl7hwtgq/crun-1.17-1.20241014095439306722.main.20.g53cd1c1.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmpgl7hwtgq/crun-1.17-1.20241014095439306722.main.20.g53cd1c1.src.rpm'
tool-versioncsmock-3.7.1-1.el9