Error: CPPCHECK_WARNING (CWE-401): [#def1] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:447: error[memleak]: Memory leak: ret # 445| ret->mount = calloc (src->mount_len + 1, sizeof (*ret->mount)); # 446| if (ret->mount == NULL) # 447|-> return NULL; # 448| for (size_t i = 0; i < src->mount_len; i++) # 449| { Error: CPPCHECK_WARNING (CWE-401): [#def2] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1071: error[memleak]: Memory leak: ret # 1069| ret->parent = strdup (src->parent); # 1070| if (ret->parent == NULL) # 1071|-> return NULL; # 1072| } # 1073| if (src->host != NULL) Error: CPPCHECK_WARNING (CWE-401): [#def3] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1077: error[memleak]: Memory leak: ret # 1075| ret->host = strdup (src->host); # 1076| if (ret->host == NULL) # 1077|-> return NULL; # 1078| } # 1079| if (src->ip4 != NULL) Error: CPPCHECK_WARNING (CWE-401): [#def4] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1083: error[memleak]: Memory leak: ret # 1081| ret->ip4 = strdup (src->ip4); # 1082| if (ret->ip4 == NULL) # 1083|-> return NULL; # 1084| } # 1085| if (src->ip4addr) Error: CPPCHECK_WARNING (CWE-401): [#def5] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1090: error[memleak]: Memory leak: ret # 1088| ret->ip4addr = calloc (src->ip4addr_len + 1, sizeof (*ret->ip4addr)); # 1089| if (ret->ip4addr == NULL) # 1090|-> return NULL; # 1091| for (size_t i = 0; i < src->ip4addr_len; i++) # 1092| { Error: CPPCHECK_WARNING (CWE-401): [#def6] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1367: error[memleak]: Memory leak: ret # 1365| ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices)); # 1366| if (ret->devices == NULL) # 1367|-> return NULL; # 1368| for (size_t i = 0; i < src->devices_len; i++) # 1369| { Error: CPPCHECK_WARNING (CWE-401): [#def7] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1309: error[memleak]: Memory leak: ret # 1307| ret->hypervisor = clone_runtime_spec_schema_config_vm_hypervisor (src->hypervisor); # 1308| if (ret->hypervisor == NULL) # 1309|-> return NULL; # 1310| } # 1311| if (src->kernel) Error: CPPCHECK_WARNING (CWE-401): [#def8] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1315: error[memleak]: Memory leak: ret # 1313| ret->kernel = clone_runtime_spec_schema_config_vm_kernel (src->kernel); # 1314| if (ret->kernel == NULL) # 1315|-> return NULL; # 1316| } # 1317| if (src->image) Error: CPPCHECK_WARNING (CWE-401): [#def9] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1321: error[memleak]: Memory leak: ret # 1319| ret->image = clone_runtime_spec_schema_config_vm_image (src->image); # 1320| if (ret->image == NULL) # 1321|-> return NULL; # 1322| } # 1323| if (src->hw_config) Error: CPPCHECK_WARNING (CWE-401): [#def10] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1327: error[memleak]: Memory leak: ret # 1325| ret->hw_config = clone_runtime_spec_schema_config_vm_hw_config (src->hw_config); # 1326| if (ret->hw_config == NULL) # 1327|-> return NULL; # 1328| } # 1329| return move_ptr (ret); Error: CPPCHECK_WARNING (CWE-401): [#def11] crun-1.27/libocispec/src/ocispec/runtime_spec_schema_defs_freebsd.c:180: error[memleak]: Memory leak: ret # 178| ret->path = strdup (src->path); # 179| if (ret->path == NULL) # 180|-> return NULL; # 181| } # 182| ret->mode = src->mode; Error: COMPILER_WARNING (CWE-704): [#def12] crun-1.27/src/libcrun/cgroup-systemd.c: scope_hint: In function 'get_systemd_scope_and_slice' crun-1.27/src/libcrun/cgroup-systemd.c:125:5: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 125 | n = strchr (cgroup_path, ':'); # | ^ # 123| } # 124| # 125|-> n = strchr (cgroup_path, ':'); # 126| if (n == NULL) # 127| xasprintf (scope, "%s.scope", cgroup_path); Error: COMPILER_WARNING (CWE-704): [#def13] crun-1.27/src/libcrun/cgroup-systemd.c:125:5: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 123| } # 124| # 125|-> n = strchr (cgroup_path, ':'); # 126| if (n == NULL) # 127| xasprintf (scope, "%s.scope", cgroup_path); Error: COMPILER_WARNING (CWE-704): [#def14] crun-1.27/src/libcrun/cgroup-systemd.c: scope_hint: In function 'append_systemd_annotation' crun-1.27/src/libcrun/cgroup-systemd.c:641:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 641 | end = strchr (it + 1, '\''); # | ^ # 639| it = v_start = xstrdup (value); # 640| # 641|-> end = strchr (it + 1, '\''); # 642| if (end == NULL) # 643| return crun_make_error (err, 0, "invalid variant `%s`", value); Error: COMPILER_WARNING (CWE-704): [#def15] crun-1.27/src/libcrun/cgroup-systemd.c:641:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 639| it = v_start = xstrdup (value); # 640| # 641|-> end = strchr (it + 1, '\''); # 642| if (end == NULL) # 643| return crun_make_error (err, 0, "invalid variant `%s`", value); Error: COMPILER_WARNING (CWE-704): [#def16] crun-1.27/src/libcrun/error.c: scope_hint: In function 'get_log_type' crun-1.27/src/libcrun/error.c:194:15: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type # 194 | char *sep = strchr (log, ':'); # | ^~~~~~ # 192| get_log_type (const char *log, const char **data) # 193| { # 194|-> char *sep = strchr (log, ':'); # 195| if (sep == NULL) # 196| { Error: COMPILER_WARNING (CWE-704): [#def17] crun-1.27/src/libcrun/error.c:194:15: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type # 192| get_log_type (const char *log, const char **data) # 193| { # 194|-> char *sep = strchr (log, ':'); # 195| if (sep == NULL) # 196| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] crun-1.27/src/libcrun/linux.c:6471:1: warning[-Wanalyzer-malloc-leak]: leak of 'data' crun-1.27/src/libcrun/linux.c:6402:1: enter_function: entry to 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6411:9: call_function: calling 'make_libcrun_fd_map' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6411:9: return_function: returning to 'libcrun_make_runtime_mounts' from 'make_libcrun_fd_map' crun-1.27/src/libcrun/linux.c:6413:15: branch_true: following 'true' branch (when 'i < len')... crun-1.27/src/libcrun/linux.c:6415:42: branch_true: ...to here crun-1.27/src/libcrun/linux.c:6423:13: call_function: calling 'maybe_get_idmapped_mount' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6423:13: return_function: returning to 'libcrun_make_runtime_mounts' from 'maybe_get_idmapped_mount' crun-1.27/src/libcrun/linux.c:6424:10: branch_false: following 'false' branch... crun-1.27/src/libcrun/linux.c:6427:11: branch_false: ...to here crun-1.27/src/libcrun/linux.c:6427:10: branch_true: following 'true' branch... crun-1.27/src/libcrun/linux.c:6429:16: branch_true: ...to here crun-1.27/src/libcrun/linux.c:6432:15: call_function: calling 'is_bind_mount' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6432:15: return_function: returning to 'libcrun_make_runtime_mounts' from 'is_bind_mount' crun-1.27/src/libcrun/linux.c:6440:21: call_function: calling 'open_mount_of_type' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6440:21: return_function: returning to 'libcrun_make_runtime_mounts' from 'open_mount_of_type' crun-1.27/src/libcrun/linux.c:6441:18: branch_false: following 'false' branch... crun-1.27/src/libcrun/linux.c:6471:1: branch_false: ...to here crun-1.27/src/libcrun/linux.c:6446:10: branch_true: following 'true' branch... crun-1.27/src/libcrun/linux.c:6447:47: branch_true: ...to here crun-1.27/src/libcrun/linux.c:6447:17: call_function: calling 'get_default_flags' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6447:17: return_function: returning to 'libcrun_make_runtime_mounts' from 'get_default_flags' crun-1.27/src/libcrun/linux.c:6456:13: call_function: calling 'do_mount_setattr' from 'libcrun_make_runtime_mounts' crun-1.27/src/libcrun/linux.c:6456:13: return_function: returning to 'libcrun_make_runtime_mounts' from 'do_mount_setattr' crun-1.27/src/libcrun/linux.c:6471:1: danger: 'data' leaks here; was allocated at [(59)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/58) # 6469| # 6470| return run_in_container_namespace (status, do_mount_in_a_container, &args, err); # 6471|-> } # 6472| # 6473| int Error: COMPILER_WARNING (CWE-704): [#def19] crun-1.27/src/libcrun/utils.c: scope_hint: In function 'crun_safe_ensure_at' crun-1.27/src/libcrun/utils.c:578:10: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 578 | it = strchr (cur, '/'); # | ^ # 576| cur = consume_slashes (it + 1); # 577| *it = '/'; # 578|-> it = strchr (cur, '/'); # 579| } # 580| Error: COMPILER_WARNING (CWE-704): [#def20] crun-1.27/src/libcrun/utils.c:578:10: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 576| cur = consume_slashes (it + 1); # 577| *it = '/'; # 578|-> it = strchr (cur, '/'); # 579| } # 580|
| analyzer-version-clippy | 1.95.0 |
| analyzer-version-cppcheck | 2.20.0 |
| analyzer-version-gcc | 16.0.1 |
| analyzer-version-gcc-analyzer | 16.0.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.95.0 |
| diffbase-analyzer-version-cppcheck | 2.20.0 |
| diffbase-analyzer-version-gcc | 16.0.1 |
| diffbase-analyzer-version-gcc-analyzer | 16.0.1 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-243.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | crun-1.27.1-1.fc45 |
| diffbase-store-results-to | /tmp/tmp9nwnma58/crun-1.27.1-1.fc45.tar.xz |
| diffbase-time-created | 2026-04-28 14:50:50 |
| diffbase-time-finished | 2026-04-28 14:53:14 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp9nwnma58/crun-1.27.1-1.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp9nwnma58/crun-1.27.1-1.fc45.src.rpm' |
| diffbase-tool-version | csmock-3.8.5-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-243.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | crun-1.27-1.fc44 |
| store-results-to | /tmp/tmp7taxqodc/crun-1.27-1.fc44.tar.xz |
| time-created | 2026-04-28 14:47:03 |
| time-finished | 2026-04-28 14:50:26 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,gcc,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp7taxqodc/crun-1.27-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7taxqodc/crun-1.27-1.fc44.src.rpm' |
| tool-version | csmock-3.8.5-1.el9 |