Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-401): [#def1]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3993: error[memleak]: Memory leak: ret
# 3991|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 3992|           if (ret->devices == NULL)
# 3993|->           return NULL;
# 3994|           for (size_t i = 0; i < src->devices_len; i++)
# 3995|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:602:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx,  err)'
#  600|         return NULL;
#  601|       ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
#  602|->     if (ret->memory == NULL && *err != 0)
#  603|         return NULL;
#  604|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update'
crun-HEAD/src/libcrun/utils.h:74:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(176)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/container.c:582:7: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/container.c:1626:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.1.1
analyzer-version-gcc-analyzer15.1.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.86.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.1.1
diffbase-analyzer-version-gcc-analyzer15.1.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-64.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250509.165649.g41c6174.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.21-1.20250513081132445027.pr1748.95.ge8a4d2b2
diffbase-store-results-to/tmp/tmpt_pgeqq3/crun-1.21-1.20250513081132445027.pr1748.95.ge8a4d2b2.tar.xz
diffbase-time-created2025-05-13 08:25:47
diffbase-time-finished2025-05-13 08:31:33
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpt_pgeqq3/crun-1.21-1.20250513081132445027.pr1748.95.ge8a4d2b2.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpt_pgeqq3/crun-1.21-1.20250513081132445027.pr1748.95.ge8a4d2b2.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-64.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250509.165649.g41c6174.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.21-1.20250512094810910083.main.93.g819c2a76
store-results-to/tmp/tmpa98q2twb/crun-1.21-1.20250512094810910083.main.93.g819c2a76.tar.xz
time-created2025-05-13 08:19:57
time-finished2025-05-13 08:25:18
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpa98q2twb/crun-1.21-1.20250512094810910083.main.93.g819c2a76.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpa98q2twb/crun-1.21-1.20250512094810910083.main.93.g819c2a76.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9