Task #115633 - added.err

back to task #115633
download
Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/basic_test_map_string_string_array.c:159: error[memleak]: Memory leak: ret
#  157|         ret->maps = calloc (src->maps_len + 1, sizeof (*ret->maps));
#  158|         if (ret->maps == NULL)
#  159|->         return NULL;
#  160|         for (size_t i = 0; i < src->maps_len; i++)
#  161|           {

Error: GCC_ANALYZER_WARNING (CWE-401):
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:83:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#   81|               const char *str = json_object_get_string (val);
#   82|               ret->urls[i] = strdup (str ? str : "");
#   83|->             if (ret->urls[i] == NULL)
#   84|                 return NULL;
#   85|             }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_index_schema.c: scope_hint: In function 'make_image_spec_schema_image_index_schema_manifests_element'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:395:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#  393|               const char *str = json_object_get_string (val);
#  394|               ret->urls[i] = strdup (str ? str : "");
#  395|->             if (ret->urls[i] == NULL)
#  396|                 return NULL;
#  397|             }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.c:1498:7: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
/usr/include/json-c/json.h:27: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.c:6: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.c:1506:1: note: in expansion of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.h:41:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_int64.part.0'
# 1496|             map->keys[i] = NULL;
# 1497|           }
# 1498|->       free (map->keys);
# 1499|         map->keys = NULL;
# 1500|         free (map->values);

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux_seccomp'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2526:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 2524|               const char *str = json_object_get_string (val);
# 2525|               ret->flags[i] = strdup (str ? str : "");
# 2526|->             if (ret->flags[i] == NULL)
# 2527|                 return NULL;
# 2528|             }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2572:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 2570|               const char *str = json_object_get_string (val);
# 2571|               ret->architectures[i] = strdup (str ? str : "");
# 2572|->             if (ret->architectures[i] == NULL)
# 2573|                 return NULL;
# 2574|             }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema_process_scheduler'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1903:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
# 1901|               const char *str = json_object_get_string (val);
# 1902|               ret->flags[i] = strdup (str ? str : "");
# 1903|->             if (ret->flags[i] == NULL)
# 1904|                 return NULL;
# 1905|             }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm_hw_config'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:711:16: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(<unknown>)'
#  709|               const char *str = json_object_get_string (val);
#  710|               ret->dtdevs[i] = strdup (str ? str : "");
#  711|->             if (ret->dtdevs[i] == NULL)
#  712|                 return NULL;
#  713|             }

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