Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: scope_hint: In function 'make_image_spec_schema_content_descriptor'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def3]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c:89: error[memleak]: Memory leak: ret
#   87|           ret->values = calloc (len + 1, sizeof (*ret->values));
#   88|           if (ret->values == NULL)
#   89|->           return NULL;
#   90|           for (i = 0; i < len; i++)
#   91|             {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'clone_image_spec_schema_defs_map_string_object'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c:178:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'calloc(*src.len + 1, 8)'
#  176|           for (i = 0; i < src->len; i++)
#  177|             {
#  178|->              ret->values[i] = clone_image_spec_schema_defs_map_string_object_element (src->values[i]);
#  179|                if (ret->values[i] == NULL)
#  180|                  return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: scope_hint: In function 'make_image_spec_schema_image_layout_schema'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def7]
crun-HEAD/libocispec/src/ocispec/json_common.c:713: error[memleak]: Memory leak: ret
#  711|     if (ret->keys == NULL)
#  712|       {
#  713|->       return NULL;
#  714|       }
#  715|     ret->values = calloc (len + 1, sizeof (bool));

Error: CPPCHECK_WARNING (CWE-401): [#def8]
crun-HEAD/libocispec/src/ocispec/json_common.c:718: error[memleak]: Memory leak: ret
#  716|     if (ret->values == NULL)
#  717|       {
#  718|->       return NULL;
#  719|       }
#  720|     for (i = 0; i < len; i++)

Error: CPPCHECK_WARNING (CWE-401): [#def9]
crun-HEAD/libocispec/src/ocispec/json_common.c:888: error[memleak]: Memory leak: ret
#  886|     if (ret->keys == NULL)
#  887|       {
#  888|->       return NULL;
#  889|       }
#  890|   

Error: CPPCHECK_WARNING (CWE-401): [#def10]
crun-HEAD/libocispec/src/ocispec/json_common.c:894: error[memleak]: Memory leak: ret
#  892|     if (ret->values == NULL)
#  893|       {
#  894|->       return NULL;
#  895|       }
#  896|   

Error: CPPCHECK_WARNING (CWE-401): [#def11]
crun-HEAD/libocispec/src/ocispec/json_common.c:1050: error[memleak]: Memory leak: ret
# 1048|       {
# 1049|         *(err) = strdup ("error allocating memory");
# 1050|->       return NULL;
# 1051|       }
# 1052|     ret->values = calloc (len + 1, sizeof (int));

Error: CPPCHECK_WARNING (CWE-401): [#def12]
crun-HEAD/libocispec/src/ocispec/json_common.c:1056: error[memleak]: Memory leak: ret
# 1054|       {
# 1055|         *(err) = strdup ("error allocating memory");
# 1056|->       return NULL;
# 1057|       }
# 1058|     for (i = 0; i < len; i++)

Error: CPPCHECK_WARNING (CWE-401): [#def13]
crun-HEAD/libocispec/src/ocispec/json_common.c:1345: error[memleak]: Memory leak: ret
# 1343|     if (ret->keys == NULL)
# 1344|       {
# 1345|->       return NULL;
# 1346|       }
# 1347|   

Error: CPPCHECK_WARNING (CWE-401): [#def14]
crun-HEAD/libocispec/src/ocispec/json_common.c:1351: error[memleak]: Memory leak: ret
# 1349|     if (ret->values == NULL)
# 1350|       {
# 1351|->       return NULL;
# 1352|       }
# 1353|     for (i = 0; i < len; i++)

Error: CPPCHECK_WARNING (CWE-401): [#def15]
crun-HEAD/libocispec/src/ocispec/json_common.c:1521: error[memleak]: Memory leak: ret
# 1519|       {
# 1520|         *(err) = strdup ("error allocating memory");
# 1521|->       return NULL;
# 1522|       }
# 1523|   

Error: CPPCHECK_WARNING (CWE-401): [#def16]
crun-HEAD/libocispec/src/ocispec/json_common.c:1528: error[memleak]: Memory leak: ret
# 1526|       {
# 1527|         *(err) = strdup ("error allocating memory");
# 1528|->       return NULL;
# 1529|       }
# 1530|     for (i = 0; i < len; i++)

Error: CPPCHECK_WARNING (CWE-401): [#def17]
crun-HEAD/libocispec/src/ocispec/json_common.c:1585: error[memleak]: Memory leak: ret
# 1583|     ret->keys = calloc (src->len + 1, sizeof (char *));
# 1584|     if (ret->keys == NULL)
# 1585|->     return NULL;
# 1586|   
# 1587|     ret->values = calloc (src->len + 1, sizeof (char *));

Error: CPPCHECK_WARNING (CWE-401): [#def18]
crun-HEAD/libocispec/src/ocispec/json_common.c:1589: error[memleak]: Memory leak: ret
# 1587|     ret->values = calloc (src->len + 1, sizeof (char *));
# 1588|     if (ret->values == NULL)
# 1589|->     return NULL;
# 1590|   
# 1591|     for (i = 0; i < src->len; i++)

Error: CPPCHECK_WARNING (CWE-401): [#def19]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3670: error[memleak]: Memory leak: ret
# 3668|       ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err);
# 3669|       if (ret->monotonic == NULL && *err != 0)
# 3670|->       return NULL;
# 3671|       if (tree->type == yajl_t_object)
# 3672|         {

Error: CPPCHECK_WARNING (CWE-401): [#def20]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3682: error[memleak]: Memory leak: ret
# 3680|               resi = calloc (1, sizeof(*tree));
# 3681|               if (resi == NULL)
# 3682|->               return NULL;
# 3683|   
# 3684|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def21]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3689: error[memleak]: Memory leak: ret
# 3687|                 {
# 3688|                   yajl_tree_free (resi);
# 3689|->                 return NULL;
# 3690|                 }
# 3691|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def22]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3695: error[memleak]: Memory leak: ret
# 3693|                 {
# 3694|                   yajl_tree_free (resi);
# 3695|->                 return NULL;
# 3696|                 }
# 3697|             }

Error: CPPCHECK_WARNING (CWE-401): [#def23]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3795: error[memleak]: Memory leak: ret
# 3793|           ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);
# 3794|           if (ret->boottime == NULL)
# 3795|->           return NULL;
# 3796|         }
# 3797|       if (src->monotonic)

Error: CPPCHECK_WARNING (CWE-401): [#def24]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3801: error[memleak]: Memory leak: ret
# 3799|           ret->monotonic = clone_runtime_spec_schema_defs_linux_time_offsets (src->monotonic);
# 3800|           if (ret->monotonic == NULL)
# 3801|->           return NULL;
# 3802|         }
# 3803|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def25]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4527: error[memleak]: Memory leak: ret
# 4525|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 4526|           if (ret->devices == NULL)
# 4527|->           return NULL;
# 4528|           for (size_t i = 0; i < src->devices_len; i++)
# 4529|             {

Error: CPPCHECK_WARNING (CWE-401): [#def26]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1153: error[memleak]: Memory leak: ret
# 1151|           if (asprintf (err, "Required field '%s' not present", "kernel") < 0)
# 1152|               *err = strdup ("error allocating memory");
# 1153|->     return NULL;
# 1154|       }
# 1155|       if (tree->type == yajl_t_object)

Error: CPPCHECK_WARNING (CWE-401): [#def27]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1166: error[memleak]: Memory leak: ret
# 1164|               resi = calloc (1, sizeof(*tree));
# 1165|               if (resi == NULL)
# 1166|->               return NULL;
# 1167|   
# 1168|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def28]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1173: error[memleak]: Memory leak: ret
# 1171|                 {
# 1172|                   yajl_tree_free (resi);
# 1173|->                 return NULL;
# 1174|                 }
# 1175|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def29]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1179: error[memleak]: Memory leak: ret
# 1177|                 {
# 1178|                   yajl_tree_free (resi);
# 1179|->                 return NULL;
# 1180|                 }
# 1181|             }

Error: CPPCHECK_WARNING (CWE-401): [#def30]
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): [#def31]
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): [#def32]
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): [#def33]
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): [#def34]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:949: error[memleak]: Memory leak: ret
#  947|           ret->memory = clone_runtime_spec_schema_config_windows_resources_memory (src->memory);
#  948|           if (ret->memory == NULL)
#  949|->           return NULL;
#  950|         }
#  951|       if (src->cpu)

Error: CPPCHECK_WARNING (CWE-401): [#def35]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:955: error[memleak]: Memory leak: ret
#  953|           ret->cpu = clone_runtime_spec_schema_config_windows_resources_cpu (src->cpu);
#  954|           if (ret->cpu == NULL)
#  955|->           return NULL;
#  956|         }
#  957|       if (src->storage)

Error: CPPCHECK_WARNING (CWE-401): [#def36]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:961: error[memleak]: Memory leak: ret
#  959|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);
#  960|           if (ret->storage == NULL)
#  961|->           return NULL;
#  962|         }
#  963|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def37]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1291: error[memleak]: Memory leak: ret
# 1289|           ret->endpoint_list = calloc (src->endpoint_list_len + 1, sizeof (*ret->endpoint_list));
# 1290|           if (ret->endpoint_list == NULL)
# 1291|->           return NULL;
# 1292|           for (size_t i = 0; i < src->endpoint_list_len; i++)
# 1293|             {

Error: CPPCHECK_WARNING (CWE-401): [#def38]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1521: error[memleak]: Memory leak: ret
# 1519|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1520|           if (ret->utility_vm_path == NULL)
# 1521|->           return NULL;
# 1522|         }
# 1523|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def39]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1903: error[memleak]: Memory leak: ret
# 1901|           ret->layer_folders = calloc (src->layer_folders_len + 1, sizeof (*ret->layer_folders));
# 1902|           if (ret->layer_folders == NULL)
# 1903|->           return NULL;
# 1904|           for (size_t i = 0; i < src->layer_folders_len; i++)
# 1905|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:241:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:315:25: note: in expansion of macro 'YAJL_GET_STRING'
#  239|       if (tree == NULL)
#  240|         return NULL;
#  241|->     ret = calloc (1, sizeof (*ret));
#  242|       if (ret == NULL)
#  243|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_network_interface_priority'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2273:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2294:19: note: in expansion of macro 'YAJL_IS_NUMBER'
# 2271|       if (tree == NULL)
# 2272|         return NULL;
# 2273|->     ret = calloc (1, sizeof (*ret));
# 2274|       if (ret == NULL)
# 2275|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_namespace_reference'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2633:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2641:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2631|       if (tree == NULL)
# 2632|         return NULL;
# 2633|->     ret = calloc (1, sizeof (*ret));
# 2634|       if (ret == NULL)
# 2635|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2633:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2641:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2631|       if (tree == NULL)
# 2632|         return NULL;
# 2633|->     ret = calloc (1, sizeof (*ret));
# 2634|       if (ret == NULL)
# 2635|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: scope_hint: In function 'make_runtime_spec_schema_defs_windows_device'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c: scope_hint: In function 'make_runtime_spec_schema_defs_zos_namespace_reference'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:21:11: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   19|       if (tree == NULL)
#   20|         return NULL;
#   21|->     ret = calloc (1, sizeof (*ret));
#   22|       if (ret == NULL)
#   23|         return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def48]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1425: error[memleak]: Memory leak: ret
# 1423|                 {
# 1424|                   yajl_tree_free (resi);
# 1425|->                 return NULL;
# 1426|                 }
# 1427|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def49]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1431: error[memleak]: Memory leak: ret
# 1429|                 {
# 1430|                   yajl_tree_free (resi);
# 1431|->                 return NULL;
# 1432|                 }
# 1433|             }

Error: CPPCHECK_WARNING (CWE-401): [#def50]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1516: error[memleak]: Memory leak: ret
# 1514|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1515|           if (ret->idmap == NULL)
# 1516|->           return NULL;
# 1517|         }
# 1518|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def51]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:2025: error[memleak]: Memory leak: ret
# 2023|           ret->namespaces = calloc (src->namespaces_len + 1, sizeof (*ret->namespaces));
# 2024|           if (ret->namespaces == NULL)
# 2025|->           return NULL;
# 2026|           for (size_t i = 0; i < src->namespaces_len; i++)
# 2027|             {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def52]
crun-HEAD/src/libcrun/error.c: scope_hint: In function 'make_json_error'
crun-HEAD/src/libcrun/error.c:416:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'level'
#  414|   
#  415|     yajl_gen_string (gen, YAJL_STR ("level"), strlen ("level"));
#  416|->   yajl_gen_string (gen, YAJL_STR (level), strlen (level));
#  417|   
#  418|     yajl_gen_string (gen, YAJL_STR ("time"), strlen ("time"));

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.95.0
diffbase-analyzer-version-cppcheck2.20.0
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.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-129.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.20260420.180315.gd39a405.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecrun-1.27.1-1.20260507131634530270.pr2088.22.g5ea59937
diffbase-store-results-to/tmp/tmpya13qpx9/crun-1.27.1-1.20260507131634530270.pr2088.22.g5ea59937.tar.xz
diffbase-time-created2026-05-07 13:27:35
diffbase-time-finished2026-05-07 13:30:25
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,shellcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpya13qpx9/crun-1.27.1-1.20260507131634530270.pr2088.22.g5ea59937.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpya13qpx9/crun-1.27.1-1.20260507131634530270.pr2088.22.g5ea59937.src.rpm'
diffbase-tool-versioncsmock-3.8.5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-129.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260420.180315.gd39a405.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.27.1-1.20260507084651063521.main.20.gf658a6d0
store-results-to/tmp/tmpaiu1h2ds/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.tar.xz
time-created2026-05-07 13:23:27
time-finished2026-05-07 13:27:16
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,shellcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpaiu1h2ds/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpaiu1h2ds/crun-1.27.1-1.20260507084651063521.main.20.gf658a6d0.src.rpm'
tool-versioncsmock-3.8.5-1.el9