Fixed findings

List of Findings

Error: CPPCHECK_WARNING (CWE-401): [#def1]
crun-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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-HEAD/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;

Scan Properties

analyzer-version-clippy1.94.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.0.1
analyzer-version-gcc-analyzer16.0.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.94.0
diffbase-analyzer-version-cppcheck2.20.0
diffbase-analyzer-version-gcc16.0.1
diffbase-analyzer-version-gcc-analyzer16.0.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-143.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.20260308.181716.g94c371b.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.26-1.20260311091738101465.pr1913.143.g9ad121b0
diffbase-store-results-to/tmp/tmpjrdk8np1/crun-1.26-1.20260311091738101465.pr1913.143.g9ad121b0.tar.xz
diffbase-time-created2026-03-11 09:32:02
diffbase-time-finished2026-03-11 09:35:10
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,clippy,cppcheck,shellcheck,gcc' '-o' '/tmp/tmpjrdk8np1/crun-1.26-1.20260311091738101465.pr1913.143.g9ad121b0.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpjrdk8np1/crun-1.26-1.20260311091738101465.pr1913.143.g9ad121b0.src.rpm'
diffbase-tool-versioncsmock-3.8.4.20260302.153719.g8203630-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-143.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260308.181716.g94c371b.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.26-1.20260310140555736157.main.138.gd268d537
store-results-to/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.tar.xz
time-created2026-03-11 09:27:14
time-finished2026-03-11 09:31:38
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,clippy,cppcheck,shellcheck,gcc' '-o' '/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.src.rpm'
tool-versioncsmock-3.8.4.20260302.153719.g8203630-1.el9