crun-1.15-1.fc41
List of Defects
Error: CPPCHECK_WARNING: [#def1]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'make_basic_test_double_array'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:46:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>, ctx, err)'
# 44| {
# 45| yajl_val val = get_val (tree, "second", yajl_t_string);
# 46|-> if (val != NULL)
# 47| {
# 48| char *str = YAJL_GET_STRING (val);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:50:16: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:8: included_from: Included from here.
# 48| char *str = YAJL_GET_STRING (val);
# 49| ret->second = strdup (str ? str : "");
# 50|-> if (ret->second == NULL)
# 51| return NULL;
# 52| }
Error: CLANG_WARNING: [#def4]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:51:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 49| ret->second = strdup (str ? str : "");
# 50| if (ret->second == NULL)
# 51|-> return NULL;
# 52| }
# 53| }
Error: CLANG_WARNING: [#def5]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:131:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 129| ret->strarrays = calloc (len + 1, sizeof (*ret->strarrays));
# 130| if (ret->strarrays == NULL)
# 131|-> return NULL;
# 132| ret->strarrays_item_lens = calloc ( len + 1, sizeof (size_t));
# 133| if (ret->strarrays_item_lens == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'basic_test_double_array_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:309:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 307| while (0);
# 308|
# 309|-> if (tree->type == yajl_t_object)
# 310| {
# 311| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:309:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)'
# 307| while (0);
# 308|
# 309|-> if (tree->type == yajl_t_object)
# 310| {
# 311| size_t i;
Error: CLANG_WARNING: [#def8]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:327:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 325| {
# 326| yajl_tree_free (resi);
# 327|-> return NULL;
# 328| }
# 329| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:376:53: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.strarrays_item_lens + i * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array'
# 374| {
# 375| size_t j;
# 376|-> for (j = 0; j < ptr->strarrays_item_lens[i]; j++)
# 377| {
# 378| free (ptr->strarrays[i][j]);
Error: CLANG_WARNING: [#def10]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:491:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 489| GEN_SET_ERROR_AND_RETURN (stat, err);
# 490| }
# 491|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 492| }
# 493| stat = yajl_gen_array_close ((yajl_gen) g);
Error: CLANG_WARNING: [#def11]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:524:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 522| GEN_SET_ERROR_AND_RETURN (stat, err);
# 523| }
# 524|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 525| }
# 526| stat = yajl_gen_array_close ((yajl_gen) g);
Error: CLANG_WARNING: [#def12]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:557:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 555| GEN_SET_ERROR_AND_RETURN (stat, err);
# 556| }
# 557|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 558| }
# 559| stat = yajl_gen_array_close ((yajl_gen) g);
Error: CLANG_WARNING: [#def13]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:590:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 588| GEN_SET_ERROR_AND_RETURN (stat, err);
# 589| }
# 590|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 591| }
# 592| stat = yajl_gen_array_close ((yajl_gen) g);
Error: CLANG_WARNING: [#def14]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array.c:623:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 621| GEN_SET_ERROR_AND_RETURN (stat, err);
# 622| }
# 623|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 624| }
# 625| stat = yajl_gen_array_close ((yajl_gen) g);
Error: CPPCHECK_WARNING: [#def15]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array_item.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def16]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array_item.c:44:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 42| if (! YAJL_IS_NUMBER (val))
# 43| {
# 44|-> *err = strdup ("invalid type");
# 45| return NULL;
# 46| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array_item.c:78:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)'
# 76| while (0);
# 77|
# 78|-> if (tree->type == yajl_t_object)
# 79| {
# 80| size_t i;
Error: CLANG_WARNING: [#def18]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_double_array_item.c:96:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 94| {
# 95| yajl_tree_free (resi);
# 96|-> return NULL;
# 97| }
# 98| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def19]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_int_container_parse_data(fread_file(stream, & filesize), ctx, err)'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:151:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: CPPCHECK_WARNING (CWE-401): [#def22]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:31: error[memleak]: Memory leak: ptr
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33|
Error: CLANG_WARNING: [#def23]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:31:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:35:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 33|
# 34|
# 35|-> for (i = 0; i < alen; i++)
# 36| {
# 37| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];
Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:151:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c:151:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
# 149| }
# 150|
# 151|-> define_cleaner_function (yajl_val, yajl_tree_free)
# 152|
# 153| basic_test_top_array_int_container * basic_test_top_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)
Error: CPPCHECK_WARNING: [#def26]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_string_container_parse_data(fread_file(stream, & filesize), ctx, err)'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c:144:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: CPPCHECK_WARNING (CWE-401): [#def28]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c:31: error[memleak]: Memory leak: ptr
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33|
Error: CLANG_WARNING: [#def29]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_array_string.c:31:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33|
Error: CPPCHECK_WARNING: [#def30]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_int_container_parse_data(fread_file(stream, & filesize), ctx, err)'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: CPPCHECK_WARNING (CWE-401): [#def33]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:31: error[memleak]: Memory leak: ptr
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CLANG_WARNING: [#def34]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:31:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CPPCHECK_WARNING (CWE-401): [#def35]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:35: error[memleak]: Memory leak: ptr
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
# 34| if (ptr->subitem_lens == NULL)
# 35|-> return NULL;
# 36|
# 37| for (i = 0; i < alen; i++)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:37:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 35| return NULL;
# 36|
# 37|-> for (i = 0; i < alen; i++)
# 38| {
# 39| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];
Error: CLANG_WARNING: [#def37]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:122:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 120| GEN_SET_ERROR_AND_RETURN (stat, err);
# 121| }
# 122|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 123|
# 124|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
# 172| }
# 173|
# 174|-> define_cleaner_function (yajl_val, yajl_tree_free)
# 175|
# 176| basic_test_top_double_array_int_container * basic_test_top_double_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)
Error: CPPCHECK_WARNING: [#def39]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def40]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:51:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 49| if (! YAJL_IS_NUMBER (val))
# 50| {
# 51|-> *err = strdup ("invalid type");
# 52| return NULL;
# 53| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'make_basic_test_top_double_array_obj_container'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:68:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_obj_element(*<unknown>, ctx, err)'
# 66| {
# 67| yajl_val val = get_val (tree, "third", yajl_t_string);
# 68|-> if (val != NULL)
# 69| {
# 70| char *str = YAJL_GET_STRING (val);
Error: CPPCHECK_WARNING (CWE-401): [#def42]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:161: error[memleak]: Memory leak: ptr
# 159| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 160| if (ptr->items == NULL)
# 161|-> return NULL;
# 162| ptr->len = alen;
# 163| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CLANG_WARNING: [#def43]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:161:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 159| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 160| if (ptr->items == NULL)
# 161|-> return NULL;
# 162| ptr->len = alen;
# 163| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CPPCHECK_WARNING (CWE-401): [#def44]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:165: error[memleak]: Memory leak: ptr
# 163| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
# 164| if (ptr->subitem_lens == NULL)
# 165|-> return NULL;
# 166|
# 167| for (i = 0; i < alen; i++)
Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:199:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:8: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0'
# 197| {
# 198| size_t j;
# 199|-> for (j = 0; j < ptr->subitem_lens[i]; j++)
# 200| {
# 201| free_basic_test_top_double_array_obj_element (ptr->items[i][j]);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:201:15: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0'
# 199| for (j = 0; j < ptr->subitem_lens[i]; j++)
# 200| {
# 201|-> free_basic_test_top_double_array_obj_element (ptr->items[i][j]);
# 202| ptr->items[i][j] = NULL;
# 203| }
Error: CLANG_WARNING: [#def47]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_obj.c:244:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 242| GEN_SET_ERROR_AND_RETURN (stat, err);
# 243| }
# 244|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 245|
# 246|
Error: CPPCHECK_WARNING: [#def48]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_refobj_container_parse_data(fread_file(stream, & filesize), ctx, err)'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_refobj_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: CPPCHECK_WARNING (CWE-401): [#def51]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:31: error[memleak]: Memory leak: ptr
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CLANG_WARNING: [#def52]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:31:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CPPCHECK_WARNING (CWE-401): [#def53]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:35: error[memleak]: Memory leak: ptr
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
# 34| if (ptr->subitem_lens == NULL)
# 35|-> return NULL;
# 36|
# 37| for (i = 0; i < alen; i++)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:37:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 35| return NULL;
# 36|
# 37|-> for (i = 0; i < alen; i++)
# 38| {
# 39| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];
Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:69:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0'
# 67| {
# 68| size_t j;
# 69|-> for (j = 0; j < ptr->subitem_lens[i]; j++)
# 70| {
# 71| free_basic_test_double_array_item (ptr->items[i][j]);
Error: CLANG_WARNING: [#def56]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:114:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 112| GEN_SET_ERROR_AND_RETURN (stat, err);
# 113| }
# 114|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 115|
# 116|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
# 164| }
# 165|
# 166|-> define_cleaner_function (yajl_val, yajl_tree_free)
# 167|
# 168| basic_test_top_double_array_refobj_container * basic_test_top_double_array_refobj_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)
Error: CPPCHECK_WARNING: [#def58]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'basic_test_top_double_array_string_container_parse_file_stream'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_string_container_parse_data(fread_file(stream, & filesize), ctx, err)'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:171:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'basic_test_top_double_array_string_container_parse_file_stream'
# 18| size_t i, alen;
# 19| (void) ctx;
# 20|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
# 21| return NULL;
# 22| *err = NULL;
Error: CPPCHECK_WARNING (CWE-401): [#def60]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:31: error[memleak]: Memory leak: ptr
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CLANG_WARNING: [#def61]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:31:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 29| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 30| if (ptr->items == NULL)
# 31|-> return NULL;
# 32| ptr->len = alen;
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
Error: CPPCHECK_WARNING (CWE-401): [#def62]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:35: error[memleak]: Memory leak: ptr
# 33| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
# 34| if (ptr->subitem_lens == NULL)
# 35|-> return NULL;
# 36|
# 37| for (i = 0; i < alen; i++)
Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:74:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
# 72| {
# 73| size_t j;
# 74|-> for (j = 0; j < ptr->subitem_lens[i]; j++)
# 75| {
# 76| free (ptr->items[i][j]);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:76:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
# 74| for (j = 0; j < ptr->subitem_lens[i]; j++)
# 75| {
# 76|-> free (ptr->items[i][j]);
# 77| ptr->items[i][j] = NULL;
# 78| }
Error: CLANG_WARNING: [#def65]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/basic_test_top_double_array_string.c:119:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read
# 117| GEN_SET_ERROR_AND_RETURN (stat, err);
# 118| }
# 119|-> stat = yajl_gen_array_close ((yajl_gen) g);
# 120|
# 121|
Error: CPPCHECK_WARNING: [#def66]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def67]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->config = strdup (str ? str : "");
# 31| if (ret->config == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c: scope_hint: In function 'make_image_manifest_items_image_manifest_items_schema_container'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:106:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:8: included_from: Included from here.
# 104| return NULL;
# 105| }
# 106|-> if (ret->layers == NULL)
# 107| {
# 108| if (asprintf (err, "Required field '%s' not present", "Layers") < 0)
Error: CPPCHECK_WARNING (CWE-401): [#def69]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:263: error[memleak]: Memory leak: ptr
# 261| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 262| if (ptr->items == NULL)
# 263|-> return NULL;
# 264| ptr->len = alen;
# 265|
Error: CLANG_WARNING: [#def70]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:263:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr'
# 261| ptr->items = calloc (alen + 1, sizeof(*ptr->items));
# 262| if (ptr->items == NULL)
# 263|-> return NULL;
# 264| ptr->len = alen;
# 265|
Error: CPPCHECK_WARNING: [#def71]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def72]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:38:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 36| ret->exposed_ports = make_image_spec_schema_defs_map_string_object (get_val (tree, "ExposedPorts", yajl_t_object), ctx, err);
# 37| if (ret->exposed_ports == NULL && *err != 0)
# 38|-> return NULL;
# 39| do
# 40| {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c: scope_hint: In function 'make_image_spec_schema_config_schema'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:182:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:8: included_from: Included from here.
# 180| while (0);
# 181|
# 182|-> if (tree->type == yajl_t_object)
# 183| {
# 184| size_t i;
Error: CLANG_WARNING: [#def74]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:200:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 198| {
# 199| yajl_tree_free (resi);
# 200|-> return NULL;
# 201| }
# 202| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def75]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:531:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 529| if (ret->diff_ids == NULL)
# 530| {
# 531|-> if (asprintf (err, "Required field '%s' not present", "diff_ids") < 0)
# 532| *err = strdup ("error allocating memory");
# 533| return NULL;
Error: CLANG_WARNING: [#def76]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:560:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 558| {
# 559| yajl_tree_free (resi);
# 560|-> return NULL;
# 561| }
# 562| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def77]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:699:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 697| ret->created = strdup (str ? str : "");
# 698| if (ret->created == NULL)
# 699|-> return NULL;
# 700| }
# 701| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:745:38: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 743| {
# 744| ret->empty_layer = YAJL_IS_TRUE(val);
# 745|-> ret->empty_layer_present = 1;
# 746| }
# 747| else
Error: CLANG_WARNING: [#def79]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:873:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 871| ret->created = strdup (str ? str : "");
# 872| if (ret->created == NULL)
# 873|-> return NULL;
# 874| }
# 875| }
Error: CLANG_WARNING: [#def80]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_config_schema.c:1028:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1026| {
# 1027| yajl_tree_free (resi);
# 1028|-> return NULL;
# 1029| }
# 1030| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def81]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def82]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:44:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 42| if (! YAJL_IS_NUMBER (val))
# 43| {
# 44|-> *err = strdup ("invalid type");
# 45| return NULL;
# 46| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: scope_hint: In function 'image_spec_schema_content_descriptor_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:151:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:8: included_from: Included from here.
# 149| }
# 150|
# 151|-> if (tree->type == yajl_t_object)
# 152| {
# 153| size_t i;
Error: CLANG_WARNING: [#def84]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:169:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 167| {
# 168| yajl_tree_free (resi);
# 169|-> return NULL;
# 170| }
# 171| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def85]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-401): [#def86]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c:75: error[memleak]: Memory leak: ret
# 73| ret->keys = calloc (len + 1, sizeof (*ret->keys));
# 74| if (ret->keys == NULL)
# 75|-> return NULL;
# 76| ret->values = calloc (len + 1, sizeof (*ret->values));
# 77| if (ret->values == NULL)
Error: CLANG_WARNING: [#def87]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c:75:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 73| ret->keys = calloc (len + 1, sizeof (*ret->keys));
# 74| if (ret->keys == NULL)
# 75|-> return NULL;
# 76| ret->values = calloc (len + 1, sizeof (*ret->values));
# 77| if (ret->values == NULL)
Error: CPPCHECK_WARNING (CWE-401): [#def88]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c:78: error[memleak]: Memory leak: ret
# 76| ret->values = calloc (len + 1, sizeof (*ret->values));
# 77| if (ret->values == NULL)
# 78|-> return NULL;
# 79| for (i = 0; i < len; i++)
# 80| {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c:115:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c:8: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object'
# 113| ptr->values = NULL;
# 114| }
# 115|-> free (ptr);
# 116| }
# 117|
Error: CPPCHECK_WARNING: [#def90]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def91]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->architecture = strdup (str ? str : "");
# 31| if (ret->architecture == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c: scope_hint: In function 'make_image_spec_schema_image_index_schema_manifests_element'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:111:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:8: included_from: Included from here.
# 109| }
# 110|
# 111|-> if (tree->type == yajl_t_object)
# 112| {
# 113| size_t i;
Error: CLANG_WARNING: [#def93]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:129:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 127| {
# 128| yajl_tree_free (resi);
# 129|-> return NULL;
# 130| }
# 131| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def94]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:325:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 323| if (! YAJL_IS_NUMBER (val))
# 324| {
# 325|-> *err = strdup ("invalid type");
# 326| return NULL;
# 327| }
Error: CLANG_WARNING: [#def95]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:560:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 558| if (! YAJL_IS_NUMBER (val))
# 559| {
# 560|-> *err = strdup ("invalid type");
# 561| return NULL;
# 562| }
Error: CLANG_WARNING: [#def96]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:666:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 664| {
# 665| yajl_tree_free (resi);
# 666|-> return NULL;
# 667| }
# 668| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def97]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def98]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:38:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 36| if (ret->image_layout_version == NULL)
# 37| {
# 38|-> if (asprintf (err, "Required field '%s' not present", "imageLayoutVersion") < 0)
# 39| *err = strdup ("error allocating memory");
# 40| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: scope_hint: In function 'image_spec_schema_image_layout_schema_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:8: included_from: Included from here.
# 41| }
# 42|
# 43|-> if (tree->type == yajl_t_object)
# 44| {
# 45| size_t i;
Error: CLANG_WARNING: [#def100]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:61:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 59| {
# 60| yajl_tree_free (resi);
# 61|-> return NULL;
# 62| }
# 63| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def101]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def102]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:32:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| if (! YAJL_IS_NUMBER (val))
# 31| {
# 32|-> *err = strdup ("invalid type");
# 33| return NULL;
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:129:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 127| }
# 128|
# 129|-> if (tree->type == yajl_t_object)
# 130| {
# 131| size_t i;
Error: CLANG_WARNING: [#def104]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:147:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 145| {
# 146| yajl_tree_free (resi);
# 147|-> return NULL;
# 148| }
# 149| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'make_image_spec_schema_image_manifest_schema'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:8: included_from: Included from here.
# 179| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 180| }
# 181|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 182| ret->_residual = resi;
# 183| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 179| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 180| }
# 181|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 182| ret->_residual = resi;
# 183| }
Error: CPPCHECK_WARNING: [#def107]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-401): [#def108]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:532: error[memleak]: Memory leak: ret
# 530| if (ret->keys == NULL)
# 531| {
# 532|-> return NULL;
# 533| }
# 534|
Error: CLANG_WARNING: [#def109]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:532:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 530| if (ret->keys == NULL)
# 531| {
# 532|-> return NULL;
# 533| }
# 534|
Error: CPPCHECK_WARNING (CWE-401): [#def110]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:538: error[memleak]: Memory leak: ret
# 536| if (ret->values == NULL)
# 537| {
# 538|-> return NULL;
# 539| }
# 540|
Error: CPPCHECK_WARNING (CWE-401): [#def111]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:610: error[memleak]: Memory leak: keys
# 608| if (vals == NULL)
# 609| {
# 610|-> return -1;
# 611| }
# 612|
Error: CLANG_WARNING: [#def112]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:610:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'keys'
# 608| if (vals == NULL)
# 609| {
# 610|-> return -1;
# 611| }
# 612|
Error: CPPCHECK_WARNING (CWE-401): [#def113]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:711: error[memleak]: Memory leak: ret
# 709| if (ret->keys == NULL)
# 710| {
# 711|-> return NULL;
# 712| }
# 713| ret->values = calloc (len + 1, sizeof (bool));
Error: CLANG_WARNING: [#def114]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:711:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 709| if (ret->keys == NULL)
# 710| {
# 711|-> return NULL;
# 712| }
# 713| ret->values = calloc (len + 1, sizeof (bool));
Error: CPPCHECK_WARNING (CWE-401): [#def115]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:716: error[memleak]: Memory leak: ret
# 714| if (ret->values == NULL)
# 715| {
# 716|-> return NULL;
# 717| }
# 718| for (i = 0; i < len; i++)
Error: CPPCHECK_WARNING (CWE-401): [#def116]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:780: error[memleak]: Memory leak: keys
# 778| if (vals == NULL)
# 779| {
# 780|-> return -1;
# 781| }
# 782|
Error: CLANG_WARNING: [#def117]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:780:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'keys'
# 778| if (vals == NULL)
# 779| {
# 780|-> return -1;
# 781| }
# 782|
Error: CPPCHECK_WARNING (CWE-401): [#def118]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:885: error[memleak]: Memory leak: ret
# 883| if (ret->keys == NULL)
# 884| {
# 885|-> return NULL;
# 886| }
# 887|
Error: CLANG_WARNING: [#def119]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:885:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 883| if (ret->keys == NULL)
# 884| {
# 885|-> return NULL;
# 886| }
# 887|
Error: CPPCHECK_WARNING (CWE-401): [#def120]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:891: error[memleak]: Memory leak: ret
# 889| if (ret->values == NULL)
# 890| {
# 891|-> return NULL;
# 892| }
# 893|
Error: CLANG_WARNING: [#def121]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1045:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1043| if (ret->keys == NULL)
# 1044| {
# 1045|-> *(err) = strdup ("error allocating memory");
# 1046| return NULL;
# 1047| }
Error: CPPCHECK_WARNING (CWE-401): [#def122]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1046: error[memleak]: Memory leak: ret
# 1044| {
# 1045| *(err) = strdup ("error allocating memory");
# 1046|-> return NULL;
# 1047| }
# 1048| ret->values = calloc (len + 1, sizeof (int));
Error: CPPCHECK_WARNING (CWE-401): [#def123]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1052: error[memleak]: Memory leak: ret
# 1050| {
# 1051| *(err) = strdup ("error allocating memory");
# 1052|-> return NULL;
# 1053| }
# 1054| for (i = 0; i < len; i++)
Error: CLANG_WARNING: [#def124]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1210:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1208| if (! YAJL_IS_NUMBER (srcval))
# 1209| {
# 1210|-> if (*err == NULL && asprintf (err, "Invalid value with type 'int' for key '%s'", srckey) < 0)
# 1211| {
# 1212| *(err) = safe_strdup ("error allocating memory");
Error: CPPCHECK_WARNING (CWE-401): [#def125]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1339: error[memleak]: Memory leak: ret
# 1337| if (ret->keys == NULL)
# 1338| {
# 1339|-> return NULL;
# 1340| }
# 1341|
Error: CLANG_WARNING: [#def126]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1339:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1337| if (ret->keys == NULL)
# 1338| {
# 1339|-> return NULL;
# 1340| }
# 1341|
Error: CPPCHECK_WARNING (CWE-401): [#def127]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1345: error[memleak]: Memory leak: ret
# 1343| if (ret->values == NULL)
# 1344| {
# 1345|-> return NULL;
# 1346| }
# 1347| for (i = 0; i < len; i++)
Error: CPPCHECK_WARNING (CWE-401): [#def128]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1402: error[memleak]: Memory leak: keys
# 1400| if (vals == NULL)
# 1401| {
# 1402|-> return -1;
# 1403| }
# 1404|
Error: CLANG_WARNING: [#def129]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1402:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'keys'
# 1400| if (vals == NULL)
# 1401| {
# 1402|-> return -1;
# 1403| }
# 1404|
Error: CPPCHECK_WARNING (CWE-401): [#def130]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1408: error[memleak]: Memory leak: keys
# 1406| if (new_value == NULL)
# 1407| {
# 1408|-> return -1;
# 1409| }
# 1410|
Error: CPPCHECK_WARNING (CWE-401): [#def131]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1408: error[memleak]: Memory leak: vals
# 1406| if (new_value == NULL)
# 1407| {
# 1408|-> return -1;
# 1409| }
# 1410|
Error: CLANG_WARNING: [#def132]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1408:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'vals'
# 1406| if (new_value == NULL)
# 1407| {
# 1408|-> return -1;
# 1409| }
# 1410|
Error: GCC_ANALYZER_WARNING (CWE-457): [#def133]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1480:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*map.values'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1486:1: note: in expansion of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
# 1478| free (map->keys);
# 1479| map->keys = NULL;
# 1480|-> free (map->values);
# 1481| map->values = NULL;
# 1482| free (map);
Error: CLANG_WARNING: [#def134]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1513:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1511| if (ret->keys == NULL)
# 1512| {
# 1513|-> *(err) = strdup ("error allocating memory");
# 1514| return NULL;
# 1515| }
Error: CPPCHECK_WARNING (CWE-401): [#def135]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1514: error[memleak]: Memory leak: ret
# 1512| {
# 1513| *(err) = strdup ("error allocating memory");
# 1514|-> return NULL;
# 1515| }
# 1516|
Error: CPPCHECK_WARNING (CWE-401): [#def136]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1521: error[memleak]: Memory leak: ret
# 1519| {
# 1520| *(err) = strdup ("error allocating memory");
# 1521|-> return NULL;
# 1522| }
# 1523| for (i = 0; i < len; i++)
Error: CLANG_WARNING: [#def137]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1595:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_key'
# 1593| new_value = strdup (val ? val : "");
# 1594| if (new_value == NULL)
# 1595|-> return -1;
# 1596|
# 1597| len = map->len + 1;
Error: CLANG_WARNING: [#def138]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.c:1600:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_value'
# 1598| keys = realloc (map->keys, len * sizeof (char *));
# 1599| if (keys == NULL)
# 1600|-> return -1;
# 1601| map->keys = keys;
# 1602| keys = NULL;
Error: CPPCHECK_WARNING: [#def139]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux_resources'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:47:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_pids(get_val(tree, "pids", 3), ctx, err)'
# 45| while (0);
# 46|
# 47|-> if (tree->type == yajl_t_object)
# 48| {
# 49| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:309:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 307| while (0);
# 308|
# 309|-> if (tree->type == yajl_t_object)
# 310| {
# 311| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:309:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx, err)'
# 307| while (0);
# 308|
# 309|-> if (tree->type == yajl_t_object)
# 310| {
# 311| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1800:30: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources(get_val(tree, "resources", 3), ctx, err)'
# 1798| while (0);
# 1799| ret->pids = make_runtime_spec_schema_config_linux_resources_pids (get_val (tree, "pids", yajl_t_object), ctx, err);
# 1800|-> if (ret->pids == NULL && *err != 0)
# 1801| return NULL;
# 1802| ret->block_io = make_runtime_spec_schema_config_linux_resources_block_io (get_val (tree, "blockIO", yajl_t_object), ctx, err);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2253:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here.
# 2251| }
# 2252|
# 2253|-> if (tree->type == yajl_t_object)
# 2254| {
# 2255| size_t i;
Error: CPPCHECK_WARNING (CWE-401): [#def145]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2768: error[memleak]: Memory leak: ret
# 2766| ret->boottime = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "boottime", yajl_t_object), ctx, err);
# 2767| if (ret->boottime == NULL && *err != 0)
# 2768|-> return NULL;
# 2769| ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err);
# 2770| if (ret->monotonic == NULL && *err != 0)
Error: CPPCHECK_WARNING (CWE-401): [#def146]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2771: error[memleak]: Memory leak: ret
# 2769| ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err);
# 2770| if (ret->monotonic == NULL && *err != 0)
# 2771|-> return NULL;
# 2772|
# 2773| if (tree->type == yajl_t_object)
Error: CPPCHECK_WARNING (CWE-401): [#def147]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2784: error[memleak]: Memory leak: ret
# 2782| resi = calloc (1, sizeof(*tree));
# 2783| if (resi == NULL)
# 2784|-> return NULL;
# 2785|
# 2786| resi->type = yajl_t_object;
Error: CPPCHECK_WARNING (CWE-401): [#def148]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2791: error[memleak]: Memory leak: ret
# 2789| {
# 2790| yajl_tree_free (resi);
# 2791|-> return NULL;
# 2792| }
# 2793| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def149]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2797: error[memleak]: Memory leak: ret
# 2795| {
# 2796| yajl_tree_free (resi);
# 2797|-> return NULL;
# 2798| }
# 2799| }
Error: CPPCHECK_WARNING: [#def150]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:157:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 155| while (0);
# 156|
# 157|-> if (tree->type == yajl_t_object)
# 158| {
# 159| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:157:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx, err)'
# 155| while (0);
# 156|
# 157|-> if (tree->type == yajl_t_object)
# 158| {
# 159| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:523:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:8: included_from: Included from here.
# 521| }
# 522|
# 523|-> if (tree->type == yajl_t_object)
# 524| {
# 525| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema_process'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:691:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_console_size(get_val(tree, "consoleSize", 3), ctx, err)'
# 689| while (0);
# 690|
# 691|-> if (tree->type == yajl_t_object)
# 692| {
# 693| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:925:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 923| while (0);
# 924|
# 925|-> if (tree->type == yajl_t_object)
# 926| {
# 927| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:925:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx, err)'
# 923| while (0);
# 924|
# 925|-> if (tree->type == yajl_t_object)
# 926| {
# 927| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1234:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1232| while (0);
# 1233|
# 1234|-> if (tree->type == yajl_t_object)
# 1235| {
# 1236| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1234:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx, err)'
# 1232| while (0);
# 1233|
# 1234|-> if (tree->type == yajl_t_object)
# 1235| {
# 1236| size_t i;
Error: CPPCHECK_WARNING: [#def159]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def160]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->ncpus = strdup (str ? str : "");
# 31| if (ret->ncpus == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'make_runtime_spec_schema_config_solaris'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:37:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_cpu(get_val(tree, "cappedCPU", 3), ctx, err)'
# 35| while (0);
# 36|
# 37|-> if (tree->type == yajl_t_object)
# 38| {
# 39| size_t i;
Error: CLANG_WARNING: [#def162]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:55:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 53| {
# 54| yajl_tree_free (resi);
# 55|-> return NULL;
# 56| }
# 57| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def163]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:154:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 152| ret->physical = strdup (str ? str : "");
# 153| if (ret->physical == NULL)
# 154|-> return NULL;
# 155| }
# 156| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:171:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:8: included_from: Included from here.
# 169| while (0);
# 170|
# 171|-> if (tree->type == yajl_t_object)
# 172| {
# 173| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:171:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx, err)'
# 169| while (0);
# 170|
# 171|-> if (tree->type == yajl_t_object)
# 172| {
# 173| size_t i;
Error: CLANG_WARNING: [#def166]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:189:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 187| {
# 188| yajl_tree_free (resi);
# 189|-> return NULL;
# 190| }
# 191| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def167]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:303:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 301| ret->linkname = strdup (str ? str : "");
# 302| if (ret->linkname == NULL)
# 303|-> return NULL;
# 304| }
# 305| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:370:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 368| {
# 369| yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
# 370|-> if (val != NULL)
# 371| {
# 372| char *str = YAJL_GET_STRING (val);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def169]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:370:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val, ctx, err)'
# 368| {
# 369| yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
# 370|-> if (val != NULL)
# 371| {
# 372| char *str = YAJL_GET_STRING (val);
Error: CLANG_WARNING: [#def170]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:523:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 521| ret->milestone = strdup (str ? str : "");
# 522| if (ret->milestone == NULL)
# 523|-> return NULL;
# 524| }
# 525| }
Error: CLANG_WARNING: [#def171]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 596| {
# 597| yajl_tree_free (resi);
# 598|-> return NULL;
# 599| }
# 600| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def172]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def173]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:64:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 62| if (ret->path == NULL)
# 63| {
# 64|-> if (asprintf (err, "Required field '%s' not present", "path") < 0)
# 65| *err = strdup ("error allocating memory");
# 66| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:69:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:8: included_from: Included from here.
# 67| }
# 68|
# 69|-> if (tree->type == yajl_t_object)
# 70| {
# 71| size_t i;
Error: CLANG_WARNING: [#def175]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:87:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 85| {
# 86| yajl_tree_free (resi);
# 87|-> return NULL;
# 88| }
# 89| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def176]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:270:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 268| if (ret->path == NULL)
# 269| {
# 270|-> if (asprintf (err, "Required field '%s' not present", "path") < 0)
# 271| *err = strdup ("error allocating memory");
# 272| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:275:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 273| }
# 274|
# 275|-> if (tree->type == yajl_t_object)
# 276| {
# 277| size_t i;
Error: CLANG_WARNING: [#def178]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:293:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 291| {
# 292| yajl_tree_free (resi);
# 293|-> return NULL;
# 294| }
# 295| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def179]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:465:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 463| if (ret->path == NULL)
# 464| {
# 465|-> if (asprintf (err, "Required field '%s' not present", "path") < 0)
# 466| *err = strdup ("error allocating memory");
# 467| return NULL;
Error: CLANG_WARNING: [#def180]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:494:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 492| {
# 493| yajl_tree_free (resi);
# 494|-> return NULL;
# 495| }
# 496| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def181]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:602: error[memleak]: Memory leak: ret
# 600| ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err);
# 601| if (ret->hypervisor == NULL && *err != 0)
# 602|-> return NULL;
# 603| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
# 604| if (ret->kernel == NULL && *err != 0)
Error: CLANG_WARNING: [#def182]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:602:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 600| ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err);
# 601| if (ret->hypervisor == NULL && *err != 0)
# 602|-> return NULL;
# 603| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
# 604| if (ret->kernel == NULL && *err != 0)
Error: CPPCHECK_WARNING (CWE-401): [#def183]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:605: error[memleak]: Memory leak: ret
# 603| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
# 604| if (ret->kernel == NULL && *err != 0)
# 605|-> return NULL;
# 606| ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
# 607| if (ret->image == NULL && *err != 0)
Error: CPPCHECK_WARNING (CWE-401): [#def184]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:608: error[memleak]: Memory leak: ret
# 606| ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
# 607| if (ret->image == NULL && *err != 0)
# 608|-> return NULL;
# 609| if (ret->kernel == NULL)
# 610| {
Error: CPPCHECK_WARNING (CWE-401): [#def185]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:613: error[memleak]: Memory leak: ret
# 611| if (asprintf (err, "Required field '%s' not present", "kernel") < 0)
# 612| *err = strdup ("error allocating memory");
# 613|-> return NULL;
# 614| }
# 615|
Error: CPPCHECK_WARNING (CWE-401): [#def186]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:627: error[memleak]: Memory leak: ret
# 625| resi = calloc (1, sizeof(*tree));
# 626| if (resi == NULL)
# 627|-> return NULL;
# 628|
# 629| resi->type = yajl_t_object;
Error: CPPCHECK_WARNING (CWE-401): [#def187]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:634: error[memleak]: Memory leak: ret
# 632| {
# 633| yajl_tree_free (resi);
# 634|-> return NULL;
# 635| }
# 636| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def188]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:634:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 632| {
# 633| yajl_tree_free (resi);
# 634|-> return NULL;
# 635| }
# 636| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def189]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:640: error[memleak]: Memory leak: ret
# 638| {
# 639| yajl_tree_free (resi);
# 640|-> return NULL;
# 641| }
# 642| }
Error: CPPCHECK_WARNING: [#def190]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def191]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:32:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| if (! YAJL_IS_NUMBER (val))
# 31| {
# 32|-> *err = strdup ("invalid type");
# 33| return NULL;
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:47:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_memory(get_val(tree, "memory", 3), ctx, err)'
# 45| while (0);
# 46|
# 47|-> if (tree->type == yajl_t_object)
# 48| {
# 49| size_t i;
Error: CLANG_WARNING: [#def193]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:65:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 63| {
# 64| yajl_tree_free (resi);
# 65|-> return NULL;
# 66| }
# 67| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def194]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:162:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 160| if (! YAJL_IS_NUMBER (val))
# 161| {
# 162|-> *err = strdup ("invalid type");
# 163| return NULL;
# 164| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:221:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx, err)'
# 219| while (0);
# 220|
# 221|-> if (tree->type == yajl_t_object)
# 222| {
# 223| size_t i;
Error: CLANG_WARNING: [#def196]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:239:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 237| {
# 238| yajl_tree_free (resi);
# 239|-> return NULL;
# 240| }
# 241| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:269:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 267| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 268| }
# 269|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 270| ret->_residual = resi;
# 271| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_cpu'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:269:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 267| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 268| }
# 269|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 270| ret->_residual = resi;
# 271| }
Error: CLANG_WARNING: [#def199]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:362:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 360| if (! YAJL_IS_NUMBER (val))
# 361| {
# 362|-> *err = strdup ("invalid type");
# 363| return NULL;
# 364| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:421:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_storage(get_val(tree, "storage", 3), ctx, err)'
# 419| while (0);
# 420|
# 421|-> if (tree->type == yajl_t_object)
# 422| {
# 423| size_t i;
Error: CLANG_WARNING: [#def201]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:439:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 437| {
# 438| yajl_tree_free (resi);
# 439|-> return NULL;
# 440| }
# 441| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:469:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 467| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 468| }
# 469|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 470| ret->_residual = resi;
# 471| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_storage'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:469:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 467| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 468| }
# 469|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 470| ret->_residual = resi;
# 471| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:555:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx, err)'
# 553| return NULL;
# 554| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
# 555|-> if (ret->memory == NULL && *err != 0)
# 556| return NULL;
# 557| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
Error: CPPCHECK_WARNING (CWE-401): [#def205]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:556: error[memleak]: Memory leak: ret
# 554| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
# 555| if (ret->memory == NULL && *err != 0)
# 556|-> return NULL;
# 557| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
# 558| if (ret->cpu == NULL && *err != 0)
Error: CLANG_WARNING: [#def206]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:556:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 554| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
# 555| if (ret->memory == NULL && *err != 0)
# 556|-> return NULL;
# 557| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
# 558| if (ret->cpu == NULL && *err != 0)
Error: CPPCHECK_WARNING (CWE-401): [#def207]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:559: error[memleak]: Memory leak: ret
# 557| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
# 558| if (ret->cpu == NULL && *err != 0)
# 559|-> return NULL;
# 560| ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
# 561| if (ret->storage == NULL && *err != 0)
Error: CPPCHECK_WARNING (CWE-401): [#def208]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:562: error[memleak]: Memory leak: ret
# 560| ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
# 561| if (ret->storage == NULL && *err != 0)
# 562|-> return NULL;
# 563|
# 564| if (tree->type == yajl_t_object)
Error: CPPCHECK_WARNING (CWE-401): [#def209]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:575: error[memleak]: Memory leak: ret
# 573| resi = calloc (1, sizeof(*tree));
# 574| if (resi == NULL)
# 575|-> return NULL;
# 576|
# 577| resi->type = yajl_t_object;
Error: CPPCHECK_WARNING (CWE-401): [#def210]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:582: error[memleak]: Memory leak: ret
# 580| {
# 581| yajl_tree_free (resi);
# 582|-> return NULL;
# 583| }
# 584| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def211]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:582:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 580| {
# 581| yajl_tree_free (resi);
# 582|-> return NULL;
# 583| }
# 584| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def212]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:588: error[memleak]: Memory leak: ret
# 586| {
# 587| yajl_tree_free (resi);
# 588|-> return NULL;
# 589| }
# 590| }
Error: CLANG_WARNING: [#def213]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:714:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 712| ret->endpoint_list = calloc (len + 1, sizeof (*ret->endpoint_list));
# 713| if (ret->endpoint_list == NULL)
# 714|-> return NULL;
# 715| for (i = 0; i < len; i++)
# 716| {
Error: CLANG_WARNING: [#def214]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:817:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 815| {
# 816| yajl_tree_free (resi);
# 817|-> return NULL;
# 818| }
# 819| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def215]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1067:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1065| ret->utility_vm_path = strdup (str ? str : "");
# 1066| if (ret->utility_vm_path == NULL)
# 1067|-> return NULL;
# 1068| }
# 1069| }
Error: CLANG_WARNING: [#def216]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1090:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1088| {
# 1089| yajl_tree_free (resi);
# 1090|-> return NULL;
# 1091| }
# 1092| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def217]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1231:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1229| ret->resources = make_runtime_spec_schema_config_windows_resources (get_val (tree, "resources", yajl_t_object), ctx, err);
# 1230| if (ret->resources == NULL && *err != 0)
# 1231|-> return NULL;
# 1232| ret->network = make_runtime_spec_schema_config_windows_network (get_val (tree, "network", yajl_t_object), ctx, err);
# 1233| if (ret->network == NULL && *err != 0)
Error: CPPCHECK_WARNING: [#def218]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_zos.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def219]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_zos.c:58:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 56| resi = calloc (1, sizeof(*tree));
# 57| if (resi == NULL)
# 58|-> return NULL;
# 59|
# 60| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def220]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_zos.c:65:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 63| {
# 64| yajl_tree_free (resi);
# 65|-> return NULL;
# 66| }
# 67| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def221]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def222]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->path = strdup (str ? str : "");
# 31| if (ret->path == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: CLANG_WARNING: [#def223]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:135:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 133| {
# 134| yajl_tree_free (resi);
# 135|-> return NULL;
# 136| }
# 137| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def224]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:327:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 325| if (! YAJL_IS_NUMBER (val))
# 326| {
# 327|-> *err = strdup ("invalid type");
# 328| return NULL;
# 329| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_mount'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:386:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_id_mapping(val, ctx, err)'
# 384| while (0);
# 385|
# 386|-> if (tree->type == yajl_t_object)
# 387| {
# 388| size_t i;
Error: CLANG_WARNING: [#def226]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:404:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 402| {
# 403| yajl_tree_free (resi);
# 404|-> return NULL;
# 405| }
# 406| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_id_mapping'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:434:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 432| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 433| }
# 434|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 435| ret->_residual = resi;
# 436| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:434:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 432| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 433| }
# 434|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 435| ret->_residual = resi;
# 436| }
Error: CLANG_WARNING: [#def229]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:527:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 525| ret->source = strdup (str ? str : "");
# 526| if (ret->source == NULL)
# 527|-> return NULL;
# 528| }
# 529| }
Error: CLANG_WARNING: [#def230]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:650:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 648| {
# 649| yajl_tree_free (resi);
# 650|-> return NULL;
# 651| }
# 652| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_mount'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:683:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs.c:8: included_from: Included from here.
# 681| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 682| }
# 683|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 684| ret->_residual = resi;
# 685| }
Error: CPPCHECK_WARNING: [#def232]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def233]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->domain = strdup (str ? str : "");
# 31| if (ret->domain == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: CLANG_WARNING: [#def234]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:81:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 79| {
# 80| yajl_tree_free (resi);
# 81|-> return NULL;
# 82| }
# 83| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def235]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:220:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 218| if (! YAJL_IS_NUMBER (val))
# 219| {
# 220|-> *err = strdup ("invalid type");
# 221| return NULL;
# 222| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:297:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:8: included_from: Included from here.
# 295| }
# 296|
# 297|-> if (tree->type == yajl_t_object)
# 298| {
# 299| size_t i;
Error: CLANG_WARNING: [#def237]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:315:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 313| {
# 314| yajl_tree_free (resi);
# 315|-> return NULL;
# 316| }
# 317| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def238]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:346:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 344| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 345| }
# 346|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 347| ret->_residual = resi;
# 348| }
Error: CLANG_WARNING: [#def239]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:491:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 489| if (! YAJL_IS_NUMBER (val))
# 490| {
# 491|-> *err = strdup ("invalid type");
# 492| return NULL;
# 493| }
Error: CLANG_WARNING: [#def240]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:558:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 556| {
# 557| yajl_tree_free (resi);
# 558|-> return NULL;
# 559| }
# 560| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def241]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:749:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 747| ret->type = strdup (str ? str : "");
# 748| if (ret->type == NULL)
# 749|-> return NULL;
# 750| }
# 751| }
Error: CLANG_WARNING: [#def242]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:906:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 904| {
# 905| yajl_tree_free (resi);
# 906|-> return NULL;
# 907| }
# 908| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def243]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1085:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1083| if (! YAJL_IS_NUMBER (val))
# 1084| {
# 1085|-> *err = strdup ("invalid type");
# 1086| return NULL;
# 1087| }
Error: CLANG_WARNING: [#def244]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1140:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1138| {
# 1139| yajl_tree_free (resi);
# 1140|-> return NULL;
# 1141| }
# 1142| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_block_io_device'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1169:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1167| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1168| }
# 1169|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 1170| ret->_residual = resi;
# 1171| }
Error: CLANG_WARNING: [#def246]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1250:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1248| if (! YAJL_IS_NUMBER (val))
# 1249| {
# 1250|-> *err = strdup ("invalid type");
# 1251| return NULL;
# 1252| }
Error: CLANG_WARNING: [#def247]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1349:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1347| {
# 1348| yajl_tree_free (resi);
# 1349|-> return NULL;
# 1350| }
# 1351| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_block_io_device_weight'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1380:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1378| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1379| }
# 1380|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 1381| ret->_residual = resi;
# 1382| }
Error: CLANG_WARNING: [#def249]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1485:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1483| if (! YAJL_IS_NUMBER (val))
# 1484| {
# 1485|-> *err = strdup ("invalid type");
# 1486| return NULL;
# 1487| }
Error: CLANG_WARNING: [#def250]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1562:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1560| {
# 1561| yajl_tree_free (resi);
# 1562|-> return NULL;
# 1563| }
# 1564| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_block_io_device_throttle'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1592:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1590| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1591| }
# 1592|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 1593| ret->_residual = resi;
# 1594| }
Error: CLANG_WARNING: [#def252]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1716:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1714| if (! YAJL_IS_NUMBER (val))
# 1715| {
# 1716|-> *err = strdup ("invalid type");
# 1717| return NULL;
# 1718| }
Error: CLANG_WARNING: [#def253]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1783:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1781| {
# 1782| yajl_tree_free (resi);
# 1783|-> return NULL;
# 1784| }
# 1785| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def254]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1965:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1963| if (ret->name == NULL)
# 1964| {
# 1965|-> if (asprintf (err, "Required field '%s' not present", "name") < 0)
# 1966| *err = strdup ("error allocating memory");
# 1967| return NULL;
Error: CLANG_WARNING: [#def255]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1988:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1986| {
# 1987| yajl_tree_free (resi);
# 1988|-> return NULL;
# 1989| }
# 1990| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_network_interface_priority'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2017:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2015| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2016| }
# 2017|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 2018| ret->_residual = resi;
# 2019| }
Error: CLANG_WARNING: [#def257]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2100:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 2098| if (! YAJL_IS_NUMBER (val))
# 2099| {
# 2100|-> *err = strdup ("invalid type");
# 2101| return NULL;
# 2102| }
Error: CLANG_WARNING: [#def258]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2155:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 2153| {
# 2154| yajl_tree_free (resi);
# 2155|-> return NULL;
# 2156| }
# 2157| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_rdma'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2184:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2182| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2183| }
# 2184|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 2185| ret->_residual = resi;
# 2186| }
Error: CLANG_WARNING: [#def260]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2283:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 2281| if (ret->type == NULL)
# 2282| {
# 2283|-> if (asprintf (err, "Required field '%s' not present", "type") < 0)
# 2284| *err = strdup ("error allocating memory");
# 2285| return NULL;
Error: CLANG_WARNING: [#def261]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2306:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 2304| {
# 2305| yajl_tree_free (resi);
# 2306|-> return NULL;
# 2307| }
# 2308| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_namespace_reference'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2335:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2333| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2334| }
# 2335|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 2336| ret->_residual = resi;
# 2337| }
Error: CLANG_WARNING: [#def263]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2420:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 2418| if (! YAJL_IS_NUMBER (val))
# 2419| {
# 2420|-> *err = strdup ("invalid type");
# 2421| return NULL;
# 2422| }
Error: CLANG_WARNING: [#def264]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2475:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 2473| {
# 2474| yajl_tree_free (resi);
# 2475|-> return NULL;
# 2476| }
# 2477| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_time_offsets'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2504:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2502| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2503| }
# 2504|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 2505| ret->_residual = resi;
# 2506| }
Error: CPPCHECK_WARNING: [#def266]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def267]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:50:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 48| if (ret->id == NULL)
# 49| {
# 50|-> if (asprintf (err, "Required field '%s' not present", "id") < 0)
# 51| *err = strdup ("error allocating memory");
# 52| return NULL;
Error: CLANG_WARNING: [#def268]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:79:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 77| {
# 78| yajl_tree_free (resi);
# 79|-> return NULL;
# 80| }
# 81| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: scope_hint: In function 'make_runtime_spec_schema_defs_windows_device'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:8: included_from: Included from here.
# 106| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 107| }
# 108|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 109| ret->_residual = resi;
# 110| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 106| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 107| }
# 108|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 109| ret->_residual = resi;
# 110| }
Error: CPPCHECK_WARNING: [#def271]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def272]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->path = strdup (str ? str : "");
# 31| if (ret->path == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: CLANG_WARNING: [#def273]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:189:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 187| {
# 188| yajl_tree_free (resi);
# 189|-> return NULL;
# 190| }
# 191| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def274]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def275]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:131:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 129| resi = calloc (1, sizeof(*tree));
# 130| if (resi == NULL)
# 131|-> return NULL;
# 132|
# 133| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def276]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:138:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 136| {
# 137| yajl_tree_free (resi);
# 138|-> return NULL;
# 139| }
# 140| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def277]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:314:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 312| ret->actions = calloc (len + 1, sizeof (*ret->actions));
# 313| if (ret->actions == NULL)
# 314|-> return NULL;
# 315| for (i = 0; i < len; i++)
# 316| {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c: scope_hint: In function 'make_runtime_spec_schema_features_linux'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:434:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:8: included_from: Included from here.
# 432| while (0);
# 433|
# 434|-> if (tree->type == yajl_t_object)
# 435| {
# 436| size_t i;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:434:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_seccomp(get_val(tree, "seccomp", 3), ctx, err)'
# 432| while (0);
# 433|
# 434|-> if (tree->type == yajl_t_object)
# 435| {
# 436| size_t i;
Error: CLANG_WARNING: [#def280]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:452:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 450| {
# 451| yajl_tree_free (resi);
# 452|-> return NULL;
# 453| }
# 454| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def281]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:773:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 771| resi = calloc (1, sizeof(*tree));
# 772| if (resi == NULL)
# 773|-> return NULL;
# 774|
# 775| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def282]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:780:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 778| {
# 779| yajl_tree_free (resi);
# 780|-> return NULL;
# 781| }
# 782| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def283]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:901:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 899| resi = calloc (1, sizeof(*tree));
# 900| if (resi == NULL)
# 901|-> return NULL;
# 902|
# 903| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def284]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:908:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 906| {
# 907| yajl_tree_free (resi);
# 908|-> return NULL;
# 909| }
# 910| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def285]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1029:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1027| resi = calloc (1, sizeof(*tree));
# 1028| if (resi == NULL)
# 1029|-> return NULL;
# 1030|
# 1031| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def286]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1036:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1034| {
# 1035| yajl_tree_free (resi);
# 1036|-> return NULL;
# 1037| }
# 1038| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def287]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1157:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1155| resi = calloc (1, sizeof(*tree));
# 1156| if (resi == NULL)
# 1157|-> return NULL;
# 1158|
# 1159| resi->type = yajl_t_object;
Error: CLANG_WARNING: [#def288]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1164:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1162| {
# 1163| yajl_tree_free (resi);
# 1164|-> return NULL;
# 1165| }
# 1166| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def289]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1256: error[memleak]: Memory leak: ret
# 1254| ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1255| if (ret->idmap == NULL && *err != 0)
# 1256|-> return NULL;
# 1257|
# 1258| if (tree->type == yajl_t_object)
Error: CLANG_WARNING: [#def290]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1256:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1254| ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1255| if (ret->idmap == NULL && *err != 0)
# 1256|-> return NULL;
# 1257|
# 1258| if (tree->type == yajl_t_object)
Error: CPPCHECK_WARNING (CWE-401): [#def291]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1269: error[memleak]: Memory leak: ret
# 1267| resi = calloc (1, sizeof(*tree));
# 1268| if (resi == NULL)
# 1269|-> return NULL;
# 1270|
# 1271| resi->type = yajl_t_object;
Error: CPPCHECK_WARNING (CWE-401): [#def292]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1276: error[memleak]: Memory leak: ret
# 1274| {
# 1275| yajl_tree_free (resi);
# 1276|-> return NULL;
# 1277| }
# 1278| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CLANG_WARNING: [#def293]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1276:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1274| {
# 1275| yajl_tree_free (resi);
# 1276|-> return NULL;
# 1277| }
# 1278| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING (CWE-401): [#def294]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1282: error[memleak]: Memory leak: ret
# 1280| {
# 1281| yajl_tree_free (resi);
# 1282|-> return NULL;
# 1283| }
# 1284| }
Error: CLANG_WARNING: [#def295]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1378:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1376| ret->namespaces = calloc (len + 1, sizeof (*ret->namespaces));
# 1377| if (ret->namespaces == NULL)
# 1378|-> return NULL;
# 1379| for (i = 0; i < len; i++)
# 1380| {
Error: CLANG_WARNING: [#def296]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1456:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1454| {
# 1455| yajl_tree_free (resi);
# 1456|-> return NULL;
# 1457| }
# 1458| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def297]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def298]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->oci_version_min = strdup (str ? str : "");
# 31| if (ret->oci_version_min == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'runtime_spec_schema_features_schema_parse_data'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:160:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:8: included_from: Included from here.
# 158| }
# 159|
# 160|-> if (tree->type == yajl_t_object)
# 161| {
# 162| size_t i;
Error: CLANG_WARNING: [#def300]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:178:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 176| {
# 177| yajl_tree_free (resi);
# 178|-> return NULL;
# 179| }
# 180| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 210| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 211| }
# 212|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 213| ret->_residual = resi;
# 214| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'make_runtime_spec_schema_features_schema'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 210| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 211| }
# 212|-> if (ctx->options & OPT_PARSE_FULLKEY)
# 213| ret->_residual = resi;
# 214| }
Error: CPPCHECK_WARNING: [#def303]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_state_schema.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def304]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:32:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 30| ret->oci_version = strdup (str ? str : "");
# 31| if (ret->oci_version == NULL)
# 32|-> return NULL;
# 33| }
# 34| }
Error: CLANG_WARNING: [#def305]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:155:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 153| {
# 154| yajl_tree_free (resi);
# 155|-> return NULL;
# 156| }
# 157| resi->u.object.values = calloc (cnt, sizeof (yajl_val));
Error: CPPCHECK_WARNING: [#def306]
crun-1.15-build/crun-1.15/libocispec/tests/test-1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def307]
crun-1.15-build/crun-1.15/libocispec/tests/test-11.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def308]
crun-1.15-build/crun-1.15/libocispec/tests/test-3.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def309]
crun-1.15-build/crun-1.15/libocispec/tests/test-4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def310]
crun-1.15-build/crun-1.15/libocispec/tests/test-6.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def311]
crun-1.15-build/crun-1.15/libocispec/tests/test-7.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def312]
crun-1.15-build/crun-1.15/libocispec/tests/test-8.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def313]
crun-1.15-build/crun-1.15/libocispec/tests/test-9.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def314]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl.c:30:18: warning[deadcode.DeadStores]: Value stored to 'statStr' during its initialization is never read
# 28| yajl_status_to_string(yajl_status stat)
# 29| {
# 30|-> const char * statStr = "unknown";
# 31| switch (stat) {
# 32| case yajl_status_ok:
Error: CPPCHECK_WARNING: [#def315]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl_gen.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def316]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl_lex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def317]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl_lex.c:630:21: warning[deadcode.DeadStores]: Value stored to 'tok' is never read
# 628| /* "error" is silly, but that's the initial
# 629| * state of tok. guilty until proven innocent. */
# 630|-> tok = yajl_tok_error;
# 631| yajl_buf_clear(lexer->buf);
# 632| lexer->bufInUse = 0;
Error: CPPCHECK_WARNING: [#def318]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl_parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def319]
crun-1.15-build/crun-1.15/libocispec/yajl/src/yajl_tree.c:464:5: warning[deadcode.DeadStores]: Value stored to 'status' is never read
# 462| yajl_config(handle, yajl_allow_comments, 1);
# 463|
# 464|-> status = yajl_parse(handle,
# 465| (unsigned char *) input,
# 466| strlen (input));
Error: CPPCHECK_WARNING: [#def320]
crun-1.15-build/crun-1.15/libocispec/yajl/verify/json_verify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def321]
crun-1.15-build/crun-1.15/src/checkpoint.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def322]
crun-1.15-build/crun-1.15/src/create.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def323]
crun-1.15-build/crun-1.15/src/create.c:142:14: warning[deadcode.DeadStores]: Although the value stored to 'bundle_cleanup' is used in the enclosing expression, the value is never actually read from 'bundle_cleanup'
# 140| /* Make sure the bundle is an absolute path. */
# 141| if (bundle == NULL)
# 142|-> bundle = bundle_cleanup = getcwd (NULL, 0);
# 143| else
# 144| {
Error: CLANG_WARNING: [#def324]
crun-1.15-build/crun-1.15/src/create.c:168:33: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 166| if (getenv ("LISTEN_FDS"))
# 167| {
# 168|-> crun_context.listen_fds = strtoll (getenv ("LISTEN_FDS"), NULL, 10);
# 169| crun_context.preserve_fds += crun_context.listen_fds;
# 170| }
Error: CPPCHECK_WARNING: [#def325]
crun-1.15-build/crun-1.15/src/crun.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def326]
crun-1.15-build/crun-1.15/src/crun.c:76:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'handlers_path'
# 74| if (access (handlers_path, F_OK) == 0)
# 75| {
# 76|-> ret = libcrun_handler_manager_load_directory (handler_manager, handlers_path, &err);
# 77| if (UNLIKELY (ret < 0))
# 78| libcrun_fail_with_error (err->status, "%s", err->msg);
Error: CPPCHECK_WARNING: [#def327]
crun-1.15-build/crun-1.15/src/delete.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def328]
crun-1.15-build/crun-1.15/src/exec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def329]
crun-1.15-build/crun-1.15/src/exec.c:274:33: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 272| if (getenv ("LISTEN_FDS"))
# 273| {
# 274|-> crun_context.listen_fds = strtoll (getenv ("LISTEN_FDS"), NULL, 10);
# 275| crun_context.preserve_fds += crun_context.listen_fds;
# 276| }
Error: CPPCHECK_WARNING: [#def330]
crun-1.15-build/crun-1.15/src/kill.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def331]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def332]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:138:3: warning[deadcode.DeadStores]: Value stored to 'input' is never read
# 136|
# 137| size_t take = chunk_state_fill_buf(self, input, input_len);
# 138|-> input += take;
# 139| input_len -= take;
# 140| }
Error: CLANG_WARNING: [#def333]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:139:3: warning[deadcode.DeadStores]: Value stored to 'input_len' is never read
# 137| size_t take = chunk_state_fill_buf(self, input, input_len);
# 138| input += take;
# 139|-> input_len -= take;
# 140| }
# 141|
Error: CPPCHECK_WARNING (CWE-457): [#def334]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:186: warning[uninitvar]: Uninitialized variable: chunks_array
# 184| }
# 185|
# 186|-> blake3_hash_many(chunks_array, chunks_array_len,
# 187| BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, chunk_counter,
# 188| true, flags, CHUNK_START, CHUNK_END, out);
Error: COMPILER_WARNING (CWE-457): [#def335]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:186:3: warning[-Wmaybe-uninitialized]: 'chunks_array' may be used uninitialized
# 186 | blake3_hash_many(chunks_array, chunks_array_len,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 187 | BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, chunk_counter,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 188 | true, flags, CHUNK_START, CHUNK_END, out);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:6: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3_impl.h: scope_hint: In function 'blake3_compress_subtree_wide'
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3_impl.h:17:35: note: by argument 1 of type 'const uint8_t * const *' to 'blake3_hash_many' declared here
# 17 | #define blake3_hash_many_portable blake3_hash_many
# | ^~~~~~~~~~~~~~~~
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:177:18: note: 'chunks_array' declared here
# 177 | const uint8_t *chunks_array[MAX_SIMD_DEGREE];
# | ^~~~~~~~~~~~
# 184| }
# 185|
# 186|-> blake3_hash_many(chunks_array, chunks_array_len,
# 187| BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, chunk_counter,
# 188| true, flags, CHUNK_START, CHUNK_END, out);
Error: COMPILER_WARNING (CWE-457): [#def336]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:186:3: warning[-Wmaybe-uninitialized]: ‘chunks_array’ may be used uninitialized
# 186 | blake3_hash_many(chunks_array, chunks_array_len,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 187 | BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, chunk_counter,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 188 | true, flags, CHUNK_START, CHUNK_END, out);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:6: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3_impl.h: scope_hint: In function ‘blake3_compress_subtree_wide’
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3_impl.h:17:35: note: by argument 1 of type ‘const uint8_t * const *’ to ‘blake3_hash_many’ declared here
# 17 | #define blake3_hash_many_portable blake3_hash_many
# | ^~~~~~~~~~~~~~~~
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:177:18: note: ‘chunks_array’ declared here
# 177 | const uint8_t *chunks_array[MAX_SIMD_DEGREE];
# | ^~~~~~~~~~~~
# 184| }
# 185|
# 186|-> blake3_hash_many(chunks_array, chunks_array_len,
# 187| BLAKE3_CHUNK_LEN / BLAKE3_BLOCK_LEN, key, chunk_counter,
# 188| true, flags, CHUNK_START, CHUNK_END, out);
Error: CPPCHECK_WARNING (CWE-457): [#def337]
crun-1.15-build/crun-1.15/src/libcrun/blake3/blake3.c:229: warning[uninitvar]: Uninitialized variable: parents_array
# 227| }
# 228|
# 229|-> blake3_hash_many(parents_array, parents_array_len, 1, key,
# 230| 0, // Parents always use counter 0.
# 231| false, flags | PARENT,
Error: CPPCHECK_WARNING: [#def338]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-cgroupfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def339]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function 'libcrun_precreate_cgroup_cgroupfs'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-cgroupfs.c:82:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 720896)'
# 80| return ret;
# 81|
# 82|-> *dirfd = open (cgroup_path, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_RDONLY);
# 83| if (UNLIKELY (*dirfd < 0))
# 84| return crun_make_error (err, errno, "open `%s`", cgroup_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def340]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function ‘libcrun_precreate_cgroup_cgroupfs’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-cgroupfs.c:82:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cgroup_path, 720896)’
# 80| return ret;
# 81|
# 82|-> *dirfd = open (cgroup_path, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_RDONLY);
# 83| if (UNLIKELY (*dirfd < 0))
# 84| return crun_make_error (err, errno, "open `%s`", cgroup_path);
Error: CPPCHECK_WARNING: [#def341]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-688): [#def342]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:131:12: warning[-Wanalyzer-null-argument]: use of NULL 'controllers' where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 129| key = xstrdup (name);
# 130|
# 131|-> it = strchr (key, '.');
# 132| if (it == NULL)
# 133| {
Error: GCC_ANALYZER_WARNING (CWE-688): [#def343]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:131:12: warning[-Wanalyzer-null-argument]: use of NULL ‘controllers’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 129| key = xstrdup (name);
# 130|
# 131|-> it = strchr (key, '.');
# 132| if (it == NULL)
# 133| {
Error: CLANG_WARNING: [#def344]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:134:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'key'
# 132| if (it == NULL)
# 133| {
# 134|-> crun_error_release (err);
# 135| return crun_make_error (err, 0, "the specified key has not the form CONTROLLER.VALUE `%s`", name);
# 136| }
Error: CLANG_WARNING: [#def345]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:984:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'period_str'
# 982| ret = write_cgroup_file (dirfd_cpu, "cpu.cfs_quota_us", fmt_buf, len, err);
# 983| if (UNLIKELY (ret < 0))
# 984|-> return ret;
# 985| if (period_str != NULL)
# 986| {
Error: GCC_ANALYZER_WARNING (CWE-775): [#def346]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c: scope_hint: In function 'update_cgroup_v1_resources'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1076:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_blkio, 589824)'
# 1074| return ret;
# 1075|
# 1076|-> dirfd_blkio = open (path_to_blkio, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1077| if (UNLIKELY (dirfd_blkio < 0))
# 1078| return crun_make_error (err, errno, "open `%s`", path_to_blkio);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def347]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c: scope_hint: In function ‘update_cgroup_v1_resources’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1076:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_blkio, 589824)’
# 1074| return ret;
# 1075|
# 1076|-> dirfd_blkio = open (path_to_blkio, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1077| if (UNLIKELY (dirfd_blkio < 0))
# 1078| return crun_make_error (err, errno, "open `%s`", path_to_blkio);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def348]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1101:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_netclass, 589824)'
# 1099| return ret;
# 1100|
# 1101|-> dirfd_netclass = open (path_to_netclass, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1102| if (UNLIKELY (dirfd_netclass < 0))
# 1103| return crun_make_error (err, errno, "open `%s`", path_to_netclass);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def349]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1101:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_netclass, 589824)’
# 1099| return ret;
# 1100|
# 1101|-> dirfd_netclass = open (path_to_netclass, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1102| if (UNLIKELY (dirfd_netclass < 0))
# 1103| return crun_make_error (err, errno, "open `%s`", path_to_netclass);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def350]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1105:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_netprio, 589824)'
# 1103| return crun_make_error (err, errno, "open `%s`", path_to_netclass);
# 1104|
# 1105|-> dirfd_netprio = open (path_to_netprio, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1106| if (UNLIKELY (dirfd_netprio < 0))
# 1107| return crun_make_error (err, errno, "open `%s`", path_to_netprio);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def351]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1105:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_netprio, 589824)’
# 1103| return crun_make_error (err, errno, "open `%s`", path_to_netclass);
# 1104|
# 1105|-> dirfd_netprio = open (path_to_netprio, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1106| if (UNLIKELY (dirfd_netprio < 0))
# 1107| return crun_make_error (err, errno, "open `%s`", path_to_netprio);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def352]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1122:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_htlb, 589824)'
# 1120| if (UNLIKELY (ret < 0))
# 1121| return ret;
# 1122|-> dirfd_htlb = open (path_to_htlb, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1123| if (UNLIKELY (dirfd_htlb < 0))
# 1124| return crun_make_error (err, errno, "open `%s`", path_to_htlb);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def353]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1122:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_htlb, 589824)’
# 1120| if (UNLIKELY (ret < 0))
# 1121| return ret;
# 1122|-> dirfd_htlb = open (path_to_htlb, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 1123| if (UNLIKELY (dirfd_htlb < 0))
# 1124| return crun_make_error (err, errno, "open `%s`", path_to_htlb);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def354]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c: scope_hint: In function 'update_cgroup_v2_resources'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1263:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 589824)'
# 1261| return ret;
# 1262|
# 1263|-> cgroup_dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 1264| if (UNLIKELY (cgroup_dirfd < 0))
# 1265| return crun_make_error (err, errno, "open `%s`", cgroup_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def355]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c: scope_hint: In function ‘update_cgroup_v2_resources’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-resources.c:1263:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cgroup_path, 589824)’
# 1261| return ret;
# 1262|
# 1263|-> cgroup_dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 1264| if (UNLIKELY (cgroup_dirfd < 0))
# 1265| return crun_make_error (err, errno, "open `%s`", cgroup_path);
Error: CPPCHECK_WARNING: [#def356]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def357]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: scope_hint: In function 'initialize_cpuset_subsystem_rec'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:53:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 589824)'
# 51| int b_len;
# 52|
# 53|-> dirfd = open (path, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 54| if (UNLIKELY (dirfd < 0))
# 55| return crun_make_error (err, errno, "open `%s`", path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def358]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem_rec’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:53:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 589824)’
# 51| int b_len;
# 52|
# 53|-> dirfd = open (path, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 54| if (UNLIKELY (dirfd < 0))
# 55| return crun_make_error (err, errno, "open `%s`", path);
Error: CLANG_WARNING: [#def359]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:123:16: warning[deadcode.DeadStores]: Although the value stored to 'allocated_cpus' is used in the enclosing expression, the value is never actually read from 'allocated_cpus'
# 121| {
# 122| if (resources->cpu->cpus && ! has_cpus)
# 123|-> cpus = allocated_cpus = xstrdup (resources->cpu->cpus);
# 124| if (resources->cpu->mems && ! has_mems)
# 125| mems = allocated_mems = xstrdup (resources->cpu->mems);
Error: CLANG_WARNING: [#def360]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:125:16: warning[deadcode.DeadStores]: Although the value stored to 'allocated_mems' is used in the enclosing expression, the value is never actually read from 'allocated_mems'
# 123| cpus = allocated_cpus = xstrdup (resources->cpu->cpus);
# 124| if (resources->cpu->mems && ! has_mems)
# 125|-> mems = allocated_mems = xstrdup (resources->cpu->mems);
# 126| }
# 127|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def361]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:155:10: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 153|
# 154| cpus_buf[0] = mems_buf[0] = '\0';
# 155|-> return initialize_cpuset_subsystem_rec (tmp_path, strlen (tmp_path), cpus_buf, mems_buf, NULL, err);
# 156| }
# 157|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def362]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL 'cgroup_crun_exec_path' where non-null expected
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro 'crun_make_error'
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/container.h:23: included_from: Included from here.
/usr/include/string.h:159:12: note: argument 2 of 'strncmp' must be non-null
# 459|
# 460| /* Make sure the cgroup is below the initial cgroup specified for the container. */
# 461|-> if (strncmp (path, cgroup_crun_exec_path, strlen (path)))
# 462| {
# 463| free (cgroup_crun_exec_path);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def363]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c: scope_hint: In function ‘enter_cgroup_v2’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL ‘cgroup_crun_exec_path’ where non-null expected
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro ‘crun_make_error’
crun-1.15-build/crun-1.15/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/container.h:23: included_from: Included from here.
/usr/include/string.h:159:12: note: argument 2 of ‘strncmp’ must be non-null
# 459|
# 460| /* Make sure the cgroup is below the initial cgroup specified for the container. */
# 461|-> if (strncmp (path, cgroup_crun_exec_path, strlen (path)))
# 462| {
# 463| free (cgroup_crun_exec_path);
Error: CPPCHECK_WARNING: [#def364]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def365]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:93:28: warning[core.NullDereference]: Array access (from variable 'mask') results in a null pointer dereference
# 91|
# 92| for (long long i = start_range; i <= end_range; i++)
# 93|-> mask[i / CHAR_BIT] |= (1 << (i % CHAR_BIT));
# 94|
# 95| if (*p == ',')
Error: CLANG_WARNING: [#def366]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:108:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'mask'
# 106|
# 107| invalid_input:
# 108|-> return crun_make_error (err, 0, "cannot parse input `%s`", str);
# 109| }
# 110|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def367]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'setup_cpuset_for_systemd_v1'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:269:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cpuset, 589824)'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'setup_cpuset_for_systemd_v1'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'setup_cpuset_for_systemd_v1'
# 267| return ret;
# 268|
# 269|-> dirfd_cpuset = open (path_to_cpuset, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 270| if (UNLIKELY (dirfd_cpuset < 0))
# 271| return crun_make_error (err, errno, "open `%s`", path_to_cpuset);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def368]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘setup_cpuset_for_systemd_v1’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:269:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_cpuset, 589824)’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘setup_cpuset_for_systemd_v1’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘setup_cpuset_for_systemd_v1’
# 267| return ret;
# 268|
# 269|-> dirfd_cpuset = open (path_to_cpuset, O_DIRECTORY | O_RDONLY | O_CLOEXEC);
# 270| if (UNLIKELY (dirfd_cpuset < 0))
# 271| return crun_make_error (err, errno, "open `%s`", path_to_cpuset);
Error: CLANG_WARNING: [#def369]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:330:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 328|
# 329| if (geteuid ())
# 330|-> return 0;
# 331|
# 332| ret = setup_rt_runtime (resources, path, err);
Error: CLANG_WARNING: [#def370]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:605:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'name'
# 603| return crun_make_error (err, -sd_err, "sd-bus message append `%s`", name);
# 604|
# 605|-> return 0;
# 606| }
# 607| else if (*it == '\'')
Error: CLANG_WARNING: [#def371]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:612:12: warning[deadcode.DeadStores]: Although the value stored to 'v_start' is used in the enclosing expression, the value is never actually read from 'v_start'
# 610| char *end;
# 611|
# 612|-> it = v_start = xstrdup (value);
# 613|
# 614| end = strchr (it + 1, '\'');
Error: CLANG_WARNING: [#def372]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:616:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 614| end = strchr (it + 1, '\'');
# 615| if (end == NULL)
# 616|-> return crun_make_error (err, 0, "invalid variant `%s`", value);
# 617| *end = '\0';
# 618|
Error: CLANG_WARNING: [#def373]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:632:14: warning[deadcode.DeadStores]: Although the value stored to 'v_start' is used in the enclosing expression, the value is never actually read from 'v_start'
# 630| char *part;
# 631|
# 632|-> part = v_start = xstrdup (it + 1);
# 633| while (1)
# 634| {
Error: CLANG_WARNING: [#def374]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:640:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'parts'
# 638| ret = parse_sd_array (part, &out, &next, err);
# 639| if (UNLIKELY (ret < 0))
# 640|-> return ret;
# 641|
# 642| parts[n_parts++] = out;
Error: CLANG_WARNING: [#def375]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:655:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'part'
# 653| }
# 654|
# 655|-> sd_err = sd_bus_message_open_container (m, 'r', "sv");
# 656| if (UNLIKELY (sd_err < 0))
# 657| return crun_make_error (err, -sd_err, "sd-bus open container");
Error: CLANG_WARNING: [#def376]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:891:11: warning[deadcode.DeadStores]: Value stored to 'sd_err' is never read
# 889| quota = ((quota / 10000) + 1) * 10000;
# 890|
# 891|-> sd_err = sd_bus_message_append (m, "(sv)", "CPUQuotaPerSecUSec", "t", quota);
# 892| if (UNLIKELY (ret < 0))
# 893| return ret;
Error: CLANG_WARNING: [#def377]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:895:11: warning[deadcode.DeadStores]: Value stored to 'sd_err' is never read
# 893| return ret;
# 894|
# 895|-> sd_err = sd_bus_message_append (m, "(sv)", "CPUQuotaPeriodUSec", "t", resources->cpu->period);
# 896| if (UNLIKELY (ret < 0))
# 897| return ret;
Error: CLANG_WARNING: [#def378]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1108:3: warning[deadcode.DeadStores]: Value stored to 'sd_err' is never read
# 1106| }
# 1107|
# 1108|-> sd_err = sd_bus_message_append (m, "(sv)", "DefaultDependencies", "b", 0);
# 1109|
# 1110| for (i = 0; boolean_opts[i]; i++)
Error: CLANG_WARNING: [#def379]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1283:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'slice'
# 1281| get_systemd_scope_and_slice (id, cgroup_path, &scope, &slice);
# 1282|
# 1283|-> ret = enter_systemd_cgroup_scope (resources, cgroup_mode, args->annotations, scope, slice, pid, err);
# 1284| if (UNLIKELY (ret < 0))
# 1285| return ret;
Error: GCC_ANALYZER_WARNING (CWE-688): [#def380]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘get_cgroup_scope_path’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1309:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 1307| path_to_scope = xstrdup (cgroup_path);
# 1308|
# 1309|-> cur = strchr (path_to_scope, '/');
# 1310| while (cur)
# 1311| {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def381]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'libcrun_destroy_cgroup_systemd'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1310:10: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 1308|
# 1309| cur = strchr (path_to_scope, '/');
# 1310|-> while (cur)
# 1311| {
# 1312| char *next = strchr (cur + 1, '/');
Error: GCC_ANALYZER_WARNING (CWE-401): [#def382]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘libcrun_destroy_cgroup_systemd’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1310:10: warning[-Wanalyzer-malloc-leak]: leak of ‘get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)’
# 1308|
# 1309| cur = strchr (path_to_scope, '/');
# 1310|-> while (cur)
# 1311| {
# 1312| char *next = strchr (cur + 1, '/');
Error: GCC_ANALYZER_WARNING (CWE-401): [#def383]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1312:32: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 1310| while (cur)
# 1311| {
# 1312|-> char *next = strchr (cur + 1, '/');
# 1313| if (next == NULL)
# 1314| break;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def384]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1312:32: warning[-Wanalyzer-malloc-leak]: leak of ‘get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)’
# 1310| while (cur)
# 1311| {
# 1312|-> char *next = strchr (cur + 1, '/');
# 1313| if (next == NULL)
# 1314| break;
Error: CLANG_WARNING: [#def385]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:1351:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'path_to_scope'
# 1349| path_to_scope = get_cgroup_scope_path (cgroup_status->path, cgroup_status->scope);
# 1350|
# 1351|-> return destroy_cgroup_path (path_to_scope, mode, err);
# 1352| }
# 1353|
Error: CPPCHECK_WARNING: [#def386]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def387]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:371:11: warning[deadcode.DeadStores]: Value stored to 'child_dfd' is never read
# 369|
# 370| tmp = child_dfd;
# 371|-> child_dfd = -1;
# 372| return rmdir_all_fd (tmp);
# 373| }
Error: CLANG_WARNING: [#def388]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:624:15: warning[deadcode.DeadStores]: Value stored to 'state' during its initialization is never read
# 622| {
# 623| cleanup_free char *path = NULL;
# 624|-> const char *state = "";
# 625| int ret;
# 626|
Error: CLANG_WARNING: [#def389]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:781:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'controllers_copy'
# 779| e = crun_error_get_errno (err);
# 780| if (e != EPERM && e != EACCES && e != EBUSY && e != ENOENT && e != EOPNOTSUPP)
# 781|-> return crun_error_wrap (err, "enable controllers `%s`", controllers);
# 782|
# 783| /* ENOENT can mean both that the file doesn't exist or the controller is not present. */
Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:963:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cgroup, 720896)'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
# 961| return ret;
# 962|
# 963|-> cgroupdirfd = open (path_to_cgroup, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_RDONLY);
# 964| if (UNLIKELY (cgroupdirfd < 0))
# 965| return crun_make_error (err, errno, "open `%s`", path_to_cgroup);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def391]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c: scope_hint: In function ‘libcrun_get_cgroup_dirfd’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:963:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_cgroup, 720896)’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c: scope_hint: In function ‘libcrun_get_cgroup_dirfd’
# 961| return ret;
# 962|
# 963|-> cgroupdirfd = open (path_to_cgroup, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_RDONLY);
# 964| if (UNLIKELY (cgroupdirfd < 0))
# 965| return crun_make_error (err, errno, "open `%s`", path_to_cgroup);
Error: CPPCHECK_WARNING: [#def392]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def393]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:204:10: warning[core.NullDereference]: Access to field 'destroy_cgroup' results in a dereference of a null pointer (loaded from variable 'cgroup_manager')
# 202| return ret;
# 203|
# 204|-> return cgroup_manager->destroy_cgroup (cgroup_status, err);
# 205| }
# 206|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def394]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_destroy'
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:204:24: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
# 202| return ret;
# 203|
# 204|-> return cgroup_manager->destroy_cgroup (cgroup_status, err);
# 205| }
# 206|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def395]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_destroy’
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:204:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
# 202| return ret;
# 203|
# 204|-> return cgroup_manager->destroy_cgroup (cgroup_status, err);
# 205| }
# 206|
Error: CLANG_WARNING: [#def396]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:219:7: warning[core.NullDereference]: Access to field 'update_resources' results in a dereference of a null pointer (loaded from variable 'cgroup_manager')
# 217| return ret;
# 218|
# 219|-> if (cgroup_manager->update_resources)
# 220| {
# 221| ret = cgroup_manager->update_resources (cgroup_status, resources, err);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def397]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_update_cgroup_resources'
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:219:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
# 217| return ret;
# 218|
# 219|-> if (cgroup_manager->update_resources)
# 220| {
# 221| ret = cgroup_manager->update_resources (cgroup_status, resources, err);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def398]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_update_cgroup_resources’
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:219:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
# 217| return ret;
# 218|
# 219|-> if (cgroup_manager->update_resources)
# 220| {
# 221| ret = cgroup_manager->update_resources (cgroup_status, resources, err);
Error: CLANG_WARNING: [#def399]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:277:7: warning[core.NullDereference]: Access to field 'precreate_cgroup' results in a dereference of a null pointer (loaded from variable 'cgroup_manager')
# 275| return ret;
# 276|
# 277|-> if (cgroup_manager->precreate_cgroup == NULL)
# 278| return 0;
# 279|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def400]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_preenter'
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:277:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
# 275| return ret;
# 276|
# 277|-> if (cgroup_manager->precreate_cgroup == NULL)
# 278| return 0;
# 279|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def401]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_preenter’
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:277:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
# 275| return ret;
# 276|
# 277|-> if (cgroup_manager->precreate_cgroup == NULL)
# 278| return 0;
# 279|
Error: CLANG_WARNING: [#def402]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:297:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'status'
# 295| cgroup_mode = libcrun_get_cgroup_mode (err);
# 296| if (UNLIKELY (cgroup_mode < 0))
# 297|-> return cgroup_mode;
# 298|
# 299| /* If the cgroup configuration is limiting what CPUs/memory Nodes are available for the container,
Error: CLANG_WARNING: [#def403]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:334:9: warning[core.NullDereference]: Access to field 'create_cgroup' results in a dereference of a null pointer (loaded from variable 'cgroup_manager')
# 332| status->manager = args->manager;
# 333|
# 334|-> ret = cgroup_manager->create_cgroup (args, status, err);
# 335| if (UNLIKELY (ret < 0))
# 336| {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def404]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_enter'
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:334:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
# 332| status->manager = args->manager;
# 333|
# 334|-> ret = cgroup_manager->create_cgroup (args, status, err);
# 335| if (UNLIKELY (ret < 0))
# 336| {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def405]
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_enter’
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:334:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
# 332| status->manager = args->manager;
# 333|
# 334|-> ret = cgroup_manager->create_cgroup (args, status, err);
# 335| if (UNLIKELY (ret < 0))
# 336| {
Error: CPPCHECK_WARNING: [#def406]
crun-1.15-build/crun-1.15/src/libcrun/chroot_realpath.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def407]
crun-1.15-build/crun-1.15/src/libcrun/chroot_realpath.c:55:8: warning[deadcode.DeadStores]: Value stored to 'got_path_root' during its initialization is never read
# 53| char link_path[PATH_MAX];
# 54| char got_path[PATH_MAX];
# 55|-> char *got_path_root = got_path;
# 56| char *new_path = got_path;
# 57| char *max_path;
Error: CPPCHECK_WARNING: [#def408]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def409]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c: scope_hint: In function 'fetchve'
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of 'read_file("/proc/self/cmdline", &cmdline_size)'
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:61: included_from: Included from here.
# 188| break;
# 189|
# 190|-> copy = xrealloc(copy, (*length + n) * sizeof(*copy));
# 191| memcpy(copy + *length, buf, n);
# 192| *length += n;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def410]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c: scope_hint: In function ‘fetchve’
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of ‘read_file("/proc/self/cmdline", &cmdline_size)’
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:61: included_from: Included from here.
# 188| break;
# 189|
# 190|-> copy = xrealloc(copy, (*length + n) * sizeof(*copy));
# 191| memcpy(copy + *length, buf, n);
# 192| *length += n;
Error: CLANG_WARNING: [#def411]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:222:17: warning[core.NullDereference]: Array access results in a null pointer dereference
# 220| cur += strlen(cur) + 1;
# 221| }
# 222|-> (*output)[num] = NULL;
# 223| return num;
# 224| }
Error: GCC_ANALYZER_WARNING (CWE-476): [#def412]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c: scope_hint: In function 'parse_xargs'
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:222:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 220| cur += strlen(cur) + 1;
# 221| }
# 222|-> (*output)[num] = NULL;
# 223| return num;
# 224| }
Error: GCC_ANALYZER_WARNING (CWE-476): [#def413]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c: scope_hint: In function ‘parse_xargs’
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:222:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 220| cur += strlen(cur) + 1;
# 221| }
# 222|-> (*output)[num] = NULL;
# 223| return num;
# 224| }
Error: CLANG_WARNING: [#def414]
crun-1.15-build/crun-1.15/src/libcrun/cloned_binary.c:535:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'argv'
# 533| execfd = clone_binary();
# 534| if (execfd < 0)
# 535|-> return -EIO;
# 536|
# 537| if (putenv(CLONED_BINARY_ENV "=1"))
Error: CPPCHECK_WARNING: [#def415]
crun-1.15-build/crun-1.15/src/libcrun/container.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def416]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_load_from_file'
crun-1.15-build/crun-1.15/src/libcrun/container.c:537:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 535| container->config_file_content = xstrdup (config);
# 536|
# 537|-> return container;
# 538| }
# 539|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def417]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_load_from_file’
crun-1.15-build/crun-1.15/src/libcrun/container.c:537:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 535| container->config_file_content = xstrdup (config);
# 536|
# 537|-> return container;
# 538| }
# 539|
Error: CLANG_WARNING: [#def418]
crun-1.15-build/crun-1.15/src/libcrun/container.c:661:13: warning[deadcode.DeadStores]: Although the value stored to 'cwd_allocated' is used in the enclosing expression, the value is never actually read from 'cwd_allocated'
# 659| if (cwd == NULL)
# 660| {
# 661|-> cwd = cwd_allocated = getcwd (NULL, 0);
# 662| if (cwd == NULL)
# 663| OOM ();
Error: CLANG_WARNING: [#def419]
crun-1.15-build/crun-1.15/src/libcrun/container.c:937:7: warning[core.NullDereference]: Access to field 'annotations' results in a dereference of a null pointer (loaded from variable 'def')
# 935| }
# 936|
# 937|-> if (def->annotations && def->annotations->len)
# 938| {
# 939| size_t i;
Error: CLANG_WARNING: [#def420]
crun-1.15-build/crun-1.15/src/libcrun/container.c:1091:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'rootfs'
# 1089| ret = sync_socket_wait_sync (NULL, sync_socket, false, err);
# 1090| if (UNLIKELY (ret < 0))
# 1091|-> return ret;
# 1092|
# 1093| has_terminal = container->container_def->process && container->container_def->process->terminal;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def421]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'container_delete_internal'
crun-1.15-build/crun-1.15/src/libcrun/container.c:1695:15: warning[-Wanalyzer-null-dereference]: dereference of NULL 'container'
# 1693| return ret;
# 1694|
# 1695|-> def = container->container_def;
# 1696| }
# 1697|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def422]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘container_delete_internal’
crun-1.15-build/crun-1.15/src/libcrun/container.c:1695:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘container’
# 1693| return ret;
# 1694|
# 1695|-> def = container->container_def;
# 1696| }
# 1697|
Error: CLANG_WARNING: [#def423]
crun-1.15-build/crun-1.15/src/libcrun/container.c:1849:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'intelrdt'
# 1847|
# 1848| if (external_descriptors == NULL)
# 1849|-> return crun_make_error (err, 0, "invalid internal state. No external descriptors found");
# 1850| return libcrun_write_container_status (context->state_root, context->id, &status, err);
# 1851| }
Error: CLANG_WARNING: [#def424]
crun-1.15-build/crun-1.15/src/libcrun/container.c:2855:3: warning[deadcode.DeadStores]: Value stored to 'exec_fifo_fd' is never read
# 2853|
# 2854| context->fifo_exec_wait_fd = exec_fifo_fd;
# 2855|-> exec_fifo_fd = -1;
# 2856|
# 2857| if ((options & LIBCRUN_RUN_OPTIONS_PREFORK) == 0)
Error: CLANG_WARNING: [#def425]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3099:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 3097| goto exit;
# 3098|
# 3099|-> ret = 0;
# 3100| gen = yajl_gen_alloc (NULL);
# 3101| if (gen == NULL)
Error: CLANG_WARNING: [#def426]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3346:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'seccomp_fd_payload'
# 3344| ret = get_seccomp_receiver_fd_payload (container, "running", own_pid, &seccomp_fd_payload, &seccomp_fd_payload_len, err);
# 3345| if (UNLIKELY (ret < 0))
# 3346|-> return ret;
# 3347| }
# 3348|
Error: CLANG_WARNING: [#def427]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3399:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'seccomp_fd_payload'
# 3397| ret = get_seccomp_receiver_fd_payload (container, "running", own_pid, &seccomp_fd_payload, &seccomp_fd_payload_len, err);
# 3398| if (UNLIKELY (ret < 0))
# 3399|-> return ret;
# 3400| }
# 3401| ret = libcrun_apply_seccomp (seccomp_fd, seccomp_receiver_fd, seccomp_fd_payload,
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def428]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'exec_process_entrypoint'
crun-1.15-build/crun-1.15/src/libcrun/container.c:3414:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
# 3412|
# 3413| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1));
# 3414|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 3415| pipefd1 = -1;
# 3416|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def429]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘exec_process_entrypoint’
crun-1.15-build/crun-1.15/src/libcrun/container.c:3414:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
# 3412|
# 3413| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1));
# 3414|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 3415| pipefd1 = -1;
# 3416|
Error: CLANG_WARNING: [#def430]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3415:3: warning[deadcode.DeadStores]: Value stored to 'pipefd1' is never read
# 3413| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1));
# 3414| TEMP_FAILURE_RETRY (close (pipefd1));
# 3415|-> pipefd1 = -1;
# 3416|
# 3417| if (custom_handler)
Error: GCC_ANALYZER_WARNING (CWE-476): [#def431]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c:3583:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'process'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3581|
# 3582| /* This must be done before we enter a user namespace. */
# 3583|-> ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3584| if (UNLIKELY (ret < 0))
# 3585| return ret;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def432]
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c:3583:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘process’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3581|
# 3582| /* This must be done before we enter a user namespace. */
# 3583|-> ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3584| if (UNLIKELY (ret < 0))
# 3585| return ret;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3598:32: warning[-Wanalyzer-malloc-leak]: leak of '*process.selinux_label'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3596| {
# 3597| if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 3598|-> process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 3599|
# 3600| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3598:32: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.selinux_label’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3596| {
# 3597| if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 3598|-> process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 3599|
# 3600| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
Error: GCC_ANALYZER_WARNING (CWE-401): [#def435]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3601:35: warning[-Wanalyzer-malloc-leak]: leak of '*process.apparmor_profile'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3599|
# 3600| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 3601|-> process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 3602| }
# 3603|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3601:35: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.apparmor_profile’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3599|
# 3600| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 3601|-> process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 3602| }
# 3603|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def437]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3620:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd0'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3618| if (pid == 0)
# 3619| {
# 3620|-> TEMP_FAILURE_RETRY (close (pipefd0));
# 3621| pipefd0 = -1;
# 3622|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def438]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3620:27: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3618| if (pid == 0)
# 3619| {
# 3620|-> TEMP_FAILURE_RETRY (close (pipefd0));
# 3621| pipefd0 = -1;
# 3622|
Error: CLANG_WARNING: [#def439]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3621:7: warning[deadcode.DeadStores]: Value stored to 'pipefd0' is never read
# 3619| {
# 3620| TEMP_FAILURE_RETRY (close (pipefd0));
# 3621|-> pipefd0 = -1;
# 3622|
# 3623| exec_process_entrypoint (context, container, process, pipefd1, seccomp_fd, seccomp_receiver_fd, custom_handler, err);
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def440]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3631:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3629| }
# 3630|
# 3631|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 3632| pipefd1 = -1;
# 3633|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def441]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3631:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3629| }
# 3630|
# 3631|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 3632| pipefd1 = -1;
# 3633|
Error: CLANG_WARNING: [#def442]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3632:3: warning[deadcode.DeadStores]: Value stored to 'pipefd1' is never read
# 3630|
# 3631| TEMP_FAILURE_RETRY (close (pipefd1));
# 3632|-> pipefd1 = -1;
# 3633|
# 3634| TEMP_FAILURE_RETRY (write (pipefd0, &pid, sizeof (pid)));
Error: CLANG_WARNING: [#def443]
crun-1.15-build/crun-1.15/src/libcrun/container.c:3677:3: warning[deadcode.DeadStores]: Value stored to 'pipefd0' is never read
# 3675| ret = TEMP_FAILURE_RETRY (read (pipefd0, &b, sizeof (b)));
# 3676| TEMP_FAILURE_RETRY (close (pipefd0));
# 3677|-> pipefd0 = -1;
# 3678| if (ret != 1 || b != '0')
# 3679| ret = -1;
Error: CPPCHECK_WARNING: [#def444]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def445]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:131:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'wrapper'
# 129| wrapper->handle = dlopen ("libcriu.so.2", RTLD_NOW);
# 130| if (wrapper->handle == NULL)
# 131|-> return crun_make_error (err, 0, "could not load `libcriu.so.2`");
# 132|
# 133| LOAD_CRIU_FUNCTION (criu_add_ext_mount, false);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def446]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function 'restore_cgroup_v1_mount'
crun-1.15-build/crun-1.15/src/libcrun/criu.c:294:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 292| subsystem = strchr (from, ':') + 1;
# 293| subpath = strchr (subsystem, ':') + 1;
# 294|-> *(subpath - 1) = '\0';
# 295|
# 296| if (subsystem[0] == '\0')
Error: GCC_ANALYZER_WARNING (CWE-476): [#def447]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function ‘restore_cgroup_v1_mount’
crun-1.15-build/crun-1.15/src/libcrun/criu.c:294:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 292| subsystem = strchr (from, ':') + 1;
# 293| subpath = strchr (subsystem, ':') + 1;
# 294|-> *(subpath - 1) = '\0';
# 295|
# 296| if (subsystem[0] == '\0')
Error: GCC_ANALYZER_WARNING (CWE-476): [#def448]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:296:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 294| *(subpath - 1) = '\0';
# 295|
# 296|-> if (subsystem[0] == '\0')
# 297| continue;
# 298|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def449]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:296:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 294| *(subpath - 1) = '\0';
# 295|
# 296|-> if (subsystem[0] == '\0')
# 297| continue;
# 298|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def450]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function 'checkpoint_cgroup_v1_mount'
crun-1.15-build/crun-1.15/src/libcrun/criu.c:361:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 359| subsystem = strchr (from, ':') + 1;
# 360| subpath = strchr (subsystem, ':') + 1;
# 361|-> *(subpath - 1) = '\0';
# 362|
# 363| if (subsystem[0] == '\0')
Error: GCC_ANALYZER_WARNING (CWE-476): [#def451]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function ‘checkpoint_cgroup_v1_mount’
crun-1.15-build/crun-1.15/src/libcrun/criu.c:361:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 359| subsystem = strchr (from, ':') + 1;
# 360| subpath = strchr (subsystem, ':') + 1;
# 361|-> *(subpath - 1) = '\0';
# 362|
# 363| if (subsystem[0] == '\0')
Error: GCC_ANALYZER_WARNING (CWE-476): [#def452]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:363:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 361| *(subpath - 1) = '\0';
# 362|
# 363|-> if (subsystem[0] == '\0')
# 364| continue;
# 365|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def453]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:363:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 361| *(subpath - 1) = '\0';
# 362|
# 363|-> if (subsystem[0] == '\0')
# 364| continue;
# 365|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def454]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_checkpoint_linux_criu'
crun-1.15-build/crun-1.15/src/libcrun/criu.c:438:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 436| return crun_make_error (err, errno, "error creating checkpoint directory `%s`", cr_options->image_path);
# 437|
# 438|-> image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
# 439| if (UNLIKELY (image_fd == -1))
# 440| return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def455]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_checkpoint_linux_criu’
crun-1.15-build/crun-1.15/src/libcrun/criu.c:438:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 436| return crun_make_error (err, errno, "error creating checkpoint directory `%s`", cr_options->image_path);
# 437|
# 438|-> image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
# 439| if (UNLIKELY (image_fd == -1))
# 440| return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def456]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:458:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 456| if (cr_options->work_path != NULL)
# 457| {
# 458|-> work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
# 459| if (UNLIKELY (work_fd == -1))
# 460| return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def457]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:458:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 456| if (cr_options->work_path != NULL)
# 457| {
# 458|-> work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
# 459| if (UNLIKELY (work_fd == -1))
# 460| return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def458]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function 'prepare_restore_mounts'
crun-1.15-build/crun-1.15/src/libcrun/criu.c:703:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(root, 524288)'
# 701| }
# 702|
# 703|-> root_fd = open (root, O_RDONLY | O_CLOEXEC);
# 704| if (UNLIKELY (root_fd == -1))
# 705| return crun_make_error (err, errno, "error opening container root directory `%s`", root);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def459]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function ‘prepare_restore_mounts’
crun-1.15-build/crun-1.15/src/libcrun/criu.c:703:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(root, 524288)’
# 701| }
# 702|
# 703|-> root_fd = open (root, O_RDONLY | O_CLOEXEC);
# 704| if (UNLIKELY (root_fd == -1))
# 705| return crun_make_error (err, errno, "error opening container root directory `%s`", root);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def460]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_restore_linux_criu'
crun-1.15-build/crun-1.15/src/libcrun/criu.c:761:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 759| return crun_make_error (err, 0, "image path not set");
# 760|
# 761|-> image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
# 762| if (UNLIKELY (image_fd == -1))
# 763| return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def461]
crun-1.15-build/crun-1.15/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_restore_linux_criu’
crun-1.15-build/crun-1.15/src/libcrun/criu.c:761:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 759| return crun_make_error (err, 0, "image path not set");
# 760|
# 761|-> image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
# 762| if (UNLIKELY (image_fd == -1))
# 763| return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def462]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:817:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 815| if (cr_options->work_path != NULL)
# 816| {
# 817|-> work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
# 818| if (UNLIKELY (work_fd == -1))
# 819| return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def463]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:817:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 815| if (cr_options->work_path != NULL)
# 816| {
# 817|-> work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
# 818| if (UNLIKELY (work_fd == -1))
# 819| return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def464]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:906:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_134.path, 0)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 904| if (value == CLONE_NEWNET && def->linux->namespaces[i]->path != NULL)
# 905| {
# 906|-> inherit_new_net_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
# 907| if (UNLIKELY (inherit_new_net_fd < 0))
# 908| return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def465]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:906:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_134.path, 0)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 904| if (value == CLONE_NEWNET && def->linux->namespaces[i]->path != NULL)
# 905| {
# 906|-> inherit_new_net_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
# 907| if (UNLIKELY (inherit_new_net_fd < 0))
# 908| return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def466]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:915:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_151.path, 0)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 913| if (value == CLONE_NEWPID && def->linux->namespaces[i]->path != NULL)
# 914| {
# 915|-> inherit_new_pid_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
# 916| if (UNLIKELY (inherit_new_pid_fd < 0))
# 917| return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def467]
crun-1.15-build/crun-1.15/src/libcrun/criu.c:915:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_151.path, 0)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 913| if (value == CLONE_NEWPID && def->linux->namespaces[i]->path != NULL)
# 914| {
# 915|-> inherit_new_pid_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
# 916| if (UNLIKELY (inherit_new_pid_fd < 0))
# 917| return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);
Error: CPPCHECK_WARNING: [#def468]
crun-1.15-build/crun-1.15/src/libcrun/custom-handler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def469]
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-835): [#def470]
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: scope_hint: In function ‘read_all_progs’
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c:294:18: warning[-Wanalyzer-infinite-loop]: infinite loop
crun-1.15-build/crun-1.15/src/libcrun/ebpf.h:25: included_from: Included from here.
# 292| ret = bpf (BPF_PROG_QUERY, &attr, sizeof (attr));
# 293| }
# 294|-> while (ret < 0 && errno == ENOSPC)
# 295| ;
# 296|
Error: CPPCHECK_WARNING: [#def471]
crun-1.15-build/crun-1.15/src/libcrun/error.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def472]
crun-1.15-build/crun-1.15/src/libcrun/handlers/handler-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def473]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def474]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:186:18: warning[deadcode.DeadStores]: Although the value stored to 'rootfsfd_cleanup' is used in the enclosing expression, the value is never actually read from 'rootfsfd_cleanup'
# 184| else
# 185| {
# 186|-> rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC);
# 187| if (UNLIKELY (rootfsfd < 0))
# 188| return crun_make_error (err, errno, "open `%s`", rootfs);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def475]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container'
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:186:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(rootfs, 2621440)'
# 184| else
# 185| {
# 186|-> rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC);
# 187| if (UNLIKELY (rootfsfd < 0))
# 188| return crun_make_error (err, errno, "open `%s`", rootfs);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def476]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:186:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(rootfs, 2621440)’
# 184| else
# 185| {
# 186|-> rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC);
# 187| if (UNLIKELY (rootfsfd < 0))
# 188| return crun_make_error (err, errno, "open `%s`", rootfs);
Error: GCC_ANALYZER_WARNING (CWE-457): [#def477]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:248:6: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'create_sev'
# 246| return ret;
# 247|
# 248|-> if (create_sev)
# 249| {
# 250| ret = libcrun_create_dev (container, devfd, -1, &sev_device, is_user_ns, true, err);
Error: GCC_ANALYZER_WARNING (CWE-457): [#def478]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:248:6: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘create_sev’
# 246| return ret;
# 247|
# 248|-> if (create_sev)
# 249| {
# 250| ret = libcrun_create_dev (container, devfd, -1, &sev_device, is_user_ns, true, err);
Error: COMPILER_WARNING (CWE-457): [#def479]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container'
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: 'create_sev' may be used uninitialized
# 248 | if (create_sev)
# | ^
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:180:8: note: 'create_sev' was declared here
# 180 | bool create_sev;
# | ^~~~~~~~~~
# 246| return ret;
# 247|
# 248|-> if (create_sev)
# 249| {
# 250| ret = libcrun_create_dev (container, devfd, -1, &sev_device, is_user_ns, true, err);
Error: COMPILER_WARNING (CWE-457): [#def480]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: ‘create_sev’ may be used uninitialized
# 248 | if (create_sev)
# | ^
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:180:8: note: ‘create_sev’ was declared here
# 180 | bool create_sev;
# | ^~~~~~~~~~
# 246| return ret;
# 247|
# 248|-> if (create_sev)
# 249| {
# 250| ret = libcrun_create_dev (container, devfd, -1, &sev_device, is_user_ns, true, err);
Error: CLANG_WARNING: [#def481]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:248:7: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 246| return ret;
# 247|
# 248|-> if (create_sev)
# 249| {
# 250| ret = libcrun_create_dev (container, devfd, -1, &sev_device, is_user_ns, true, err);
Error: COMPILER_WARNING (CWE-563): [#def482]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_load'
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:262:9: warning[-Wunused-variable]: unused variable 'handle'
# 262 | void *handle;
# | ^~~~~~
# 260| {
# 261| struct krun_config *kconf;
# 262|-> void *handle;
# 263| const char *libkrun_so = "libkrun.so.1";
# 264| const char *libkrun_sev_so = "libkrun-sev.so.1";
Error: COMPILER_WARNING (CWE-563): [#def483]
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_load’
crun-1.15-build/crun-1.15/src/libcrun/handlers/krun.c:262:9: warning[-Wunused-variable]: unused variable ‘handle’
# 262 | void *handle;
# | ^~~~~~
# 260| {
# 261| struct krun_config *kconf;
# 262|-> void *handle;
# 263| const char *libkrun_so = "libkrun.so.1";
# 264| const char *libkrun_sev_so = "libkrun-sev.so.1";
Error: CPPCHECK_WARNING: [#def484]
crun-1.15-build/crun-1.15/src/libcrun/handlers/mono.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def485]
crun-1.15-build/crun-1.15/src/libcrun/handlers/spin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def486]
crun-1.15-build/crun-1.15/src/libcrun/handlers/wasmedge.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def487]
crun-1.15-build/crun-1.15/src/libcrun/handlers/wasmer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def488]
crun-1.15-build/crun-1.15/src/libcrun/handlers/wasmtime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def489]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def490]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:122:9: warning[deadcode.DeadStores]: Although the value stored to 'a_copy' is used in the enclosing expression, the value is never actually read from 'a_copy'
# 120| kv = xmalloc (sizeof (struct key_value) * (n_parts_a + 1));
# 121|
# 122|-> end = a_copy = xstrdup (a);
# 123| i = 0;
# 124| while ((it = strsep (&end, ";")))
Error: CLANG_WARNING: [#def491]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:130:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 128| ret = read_kv (it, &(kv[i]));
# 129| if (ret)
# 130|-> return 1;
# 131| i++;
# 132| }
Error: CLANG_WARNING: [#def492]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:130:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'kv'
# 128| ret = read_kv (it, &(kv[i]));
# 129| if (ret)
# 130|-> return 1;
# 131| i++;
# 132| }
Error: CLANG_WARNING: [#def493]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:136:9: warning[deadcode.DeadStores]: Although the value stored to 'b_copy' is used in the enclosing expression, the value is never actually read from 'b_copy'
# 134| qsort (kv, i, sizeof (struct key_value), kv_cmp);
# 135|
# 136|-> end = b_copy = xstrdup (b);
# 137| while ((it = strsep (&end, ";")))
# 138| {
Error: CLANG_WARNING: [#def494]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:154:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 152| }
# 153|
# 154|-> return 0;
# 155| }
# 156|
Error: CLANG_WARNING: [#def495]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:255:23: warning[deadcode.DeadStores]: Although the value stored to 'cleaned_l3_cache_schema' is used in the enclosing expression, the value is never actually read from 'cleaned_l3_cache_schema'
# 253|
# 254| if (l3_cache_schema && strstr (l3_cache_schema, "MB:"))
# 255|-> l3_cache_schema = cleaned_l3_cache_schema = intelrdt_clean_l3_cache_schema (l3_cache_schema);
# 256|
# 257| /* If the closID was specified and both l3cache and bwSchema are unset, the group
Error: CLANG_WARNING: [#def496]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:311:23: warning[deadcode.DeadStores]: Although the value stored to 'cleaned_l3_cache_schema' is used in the enclosing expression, the value is never actually read from 'cleaned_l3_cache_schema'
# 309|
# 310| if (l3_cache_schema && strstr (l3_cache_schema, "MB:"))
# 311|-> l3_cache_schema = cleaned_l3_cache_schema = intelrdt_clean_l3_cache_schema (l3_cache_schema);
# 312|
# 313| fd = open (path, O_WRONLY | O_CLOEXEC);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def497]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c: scope_hint: In function 'resctl_update'
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:313:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 524289)'
# 311| l3_cache_schema = cleaned_l3_cache_schema = intelrdt_clean_l3_cache_schema (l3_cache_schema);
# 312|
# 313|-> fd = open (path, O_WRONLY | O_CLOEXEC);
# 314| if (UNLIKELY (fd < 0))
# 315| return crun_make_error (err, errno, "open `%s`", path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def498]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c: scope_hint: In function ‘resctl_update’
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:313:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 524289)’
# 311| l3_cache_schema = cleaned_l3_cache_schema = intelrdt_clean_l3_cache_schema (l3_cache_schema);
# 312|
# 313|-> fd = open (path, O_WRONLY | O_CLOEXEC);
# 314| if (UNLIKELY (fd < 0))
# 315| return crun_make_error (err, errno, "open `%s`", path);
Error: CLANG_WARNING: [#def499]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:315:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'l3_cache_schema'
# 313| fd = open (path, O_WRONLY | O_CLOEXEC);
# 314| if (UNLIKELY (fd < 0))
# 315|-> return crun_make_error (err, errno, "open `%s`", path);
# 316|
# 317| ret = write_intelrdt_string (fd, path, l3_cache_schema, mem_bw_schema, err);
Error: CPPCHECK_WARNING: [#def500]
crun-1.15-build/crun-1.15/src/libcrun/io_priority.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def501]
crun-1.15-build/crun-1.15/src/libcrun/linux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def502]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:496:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'mappings'
# 494|
# 495| if (*it == '\0')
# 496|-> return crun_make_error (err, errno, "invalid mapping specified `%s`", option);
# 497|
# 498| errno = 0;
Error: CLANG_WARNING: [#def503]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:707:3: warning[deadcode.DeadStores]: Value stored to 'pid' is never read
# 705|
# 706| *pid_out = pid;
# 707|-> pid = -1;
# 708| return 0;
# 709| }
Error: CLANG_WARNING: [#def504]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:1700:21: warning[unix.Malloc]: Potential leak of memory pointed to by 'dirname'
# 1698|
# 1699| if (dirname[0] == '\0')
# 1700|-> dirfd = dup (rootfsfd);
# 1701| else
# 1702| {
Error: CLANG_WARNING: [#def505]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:1790:51: warning[core.NullDereference]: Array access (via field 'fds') results in a null pointer dereference
# 1788| if (! def->linux->devices[i]->file_mode_present)
# 1789| device.mode = 0666;
# 1790|-> ret = libcrun_create_dev (container, devfd, dev_fds->fds[i], &device, binds, true, err);
# 1791| if (UNLIKELY (ret < 0))
# 1792| return ret;
Error: CLANG_WARNING: [#def506]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2025:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer'
# 2023| part, 0755, err);
# 2024| if (UNLIKELY (parent_dir_fd < 0))
# 2025|-> return crun_make_error (err, errno, "symlink creation");
# 2026|
# 2027| /* It is safe to reuse the buffer since it was created with xstrdup (destination). */
Error: CLANG_WARNING: [#def507]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2103:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'data'
# 2101|
# 2102| if (type == NULL && (flags & MS_BIND) == 0)
# 2103|-> return crun_make_error (err, 0, "invalid mount type for `%s`", def->mounts[i]->destination);
# 2104|
# 2105| if (flags & MS_BIND)
Error: CLANG_WARNING: [#def508]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2346:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'data'
# 2344| is_dir ? 01755 : 0755, err);
# 2345| if (UNLIKELY (ret < 0))
# 2346|-> return ret;
# 2347|
# 2348| targetfd = ret;
Error: CLANG_WARNING: [#def509]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2510:36: warning[unix.Malloc]: Potential leak of memory pointed to by 'container_notify_socket_path_dir_alloc'
# 2508|
# 2509| container_notify_socket_path_dir_alloc = xstrdup (container_notify_socket_path);
# 2510|-> container_notify_socket_path_dir = dirname (container_notify_socket_path_dir_alloc);
# 2511|
# 2512| ret = crun_ensure_directory (container_notify_socket_path_dir, 0755, false, err);
Error: CLANG_WARNING: [#def510]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2558:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp'
# 2556| ret = mount (NULL, tmp, NULL, MS_PRIVATE, NULL);
# 2557| if (ret == 0)
# 2558|-> return 0;
# 2559|
# 2560| if (errno == EINVAL)
Error: CLANG_WARNING: [#def511]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:2624:18: warning[deadcode.DeadStores]: Although the value stored to 'rootfsfd_cleanup' is used in the enclosing expression, the value is never actually read from 'rootfsfd_cleanup'
# 2622| else
# 2623| {
# 2624|-> rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC);
# 2625| if (UNLIKELY (rootfsfd < 0))
# 2626| return crun_make_error (err, errno, "open `%s`", rootfs);
Error: CLANG_WARNING: [#def512]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3043:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'gid_map'
# 3041|
# 3042| xasprintf (&gid_map_file, "/proc/%d/gid_map", pid);
# 3043|-> ret = write_file (gid_map_file, gid_map, gid_map_len, err);
# 3044| if (ret < 0 && (! def->linux->gid_mappings_len || is_single_mapping (def->linux->gid_mappings, def->linux->gid_mappings_len, container->host_gid, container->container_gid)))
# 3045| {
Error: CLANG_WARNING: [#def513]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3074:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'uid_map'
# 3072|
# 3073| xasprintf (&uid_map_file, "/proc/%d/uid_map", pid);
# 3074|-> ret = write_file (uid_map_file, uid_map, uid_map_len, err);
# 3075| if (ret < 0 && (! def->linux->uid_mappings_len || is_single_mapping (def->linux->uid_mappings, def->linux->uid_mappings_len, container->host_uid, container->container_uid)))
# 3076| {
Error: CLANG_WARNING: [#def514]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3090:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'single_mapping'
# 3088| single_mapping = format_mount_mapping (container->container_uid, container->host_uid, 1, &single_mapping_len);
# 3089|
# 3090|-> ret = write_file (uid_map_file, single_mapping, single_mapping_len, err);
# 3091| }
# 3092| }
Error: CLANG_WARNING: [#def515]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3386:15: warning[deadcode.DeadStores]: Value stored to 'namespace' during its initialization is never read
# 3384| validate_sysctl (const char *original_key, const char *original_value, const char *name, unsigned long namespaces_created, runtime_spec_schema_config_schema *def, libcrun_error_t *err)
# 3385| {
# 3386|-> const char *namespace = "";
# 3387|
# 3388| name = consume_slashes (name);
Error: CLANG_WARNING: [#def516]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3488:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 3486| ret = validate_sysctl (def->linux->sysctl->keys[i], def->linux->sysctl->values[i], name, namespaces_created, def, err);
# 3487| if (UNLIKELY (ret < 0))
# 3488|-> return ret;
# 3489|
# 3490| fd = openat (dirfd, name, O_WRONLY | O_CLOEXEC);
Error: CPPCHECK_WARNING (CWE-457): [#def517]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:3651: error[uninitvar]: Uninitialized variable: code
# 3649| if (UNLIKELY (ret < 0))
# 3650| return false;
# 3651|-> *error = code;
# 3652| }
# 3653|
Error: CLANG_WARNING: [#def518]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:4861:11: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 4859|
# 4860| /* Cleanup the first process. */
# 4861|-> ret = waitpid_ignore_stopped (pid, NULL, 0);
# 4862|
# 4863| pid_to_clean = pid = new_pid;
Error: CLANG_WARNING: [#def519]
crun-1.15-build/crun-1.15/src/libcrun/linux.c:5746:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer'
# 5744| ret = syscall_getcwd (buffer, PATH_MAX);
# 5745| if (UNLIKELY (ret < 0))
# 5746|-> return crun_make_error (err, errno, "getcwd");
# 5747|
# 5748| /* Enforce that the returned path is an absolute path. */
Error: COMPILER_WARNING (CWE-252): [#def520]
crun-1.15-build/crun-1.15/src/libcrun/linux.c: scope_hint: In function 'libcrun_safe_chdir'
crun-1.15-build/crun-1.15/src/libcrun/linux.c:5751:14: warning[-Wunused-result]: ignoring return value of 'chdir' declared with attribute 'warn_unused_result'
# 5751 | (void) chdir ("/");
# | ^~~~~~~~~~~
# 5749| if (ret == 0 || buffer[0] != '/')
# 5750| {
# 5751|-> (void) chdir ("/");
# 5752| errno = ENOENT;
# 5753|
Error: COMPILER_WARNING (CWE-252): [#def521]
crun-1.15-build/crun-1.15/src/libcrun/linux.c: scope_hint: In function ‘libcrun_safe_chdir’
crun-1.15-build/crun-1.15/src/libcrun/linux.c:5751:14: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 5751 | (void) chdir ("/");
# | ^~~~~~~~~~~
# 5749| if (ret == 0 || buffer[0] != '/')
# 5750| {
# 5751|-> (void) chdir ("/");
# 5752| errno = ENOENT;
# 5753|
Error: CPPCHECK_WARNING: [#def522]
crun-1.15-build/crun-1.15/src/libcrun/mount_flags.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def523]
crun-1.15-build/crun-1.15/src/libcrun/scheduler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def524]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def525]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:461:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_rundir_dirfd(*container_44->context.state_root, err)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 459|
# 460| dir = libcrun_get_state_directory (state_root, NULL);
# 461|-> if (UNLIKELY (dir == NULL))
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def526]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:461:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_rundir_dirfd(*container_50->context.state_root, err)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 459|
# 460| dir = libcrun_get_state_directory (state_root, NULL);
# 461|-> if (UNLIKELY (dir == NULL))
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def527]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:461:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_rundir_dirfd(*container_44->context.state_root, err)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 459|
# 460| dir = libcrun_get_state_directory (state_root, NULL);
# 461|-> if (UNLIKELY (dir == NULL))
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def528]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:461:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_rundir_dirfd(*container_50->context.state_root, err)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 459|
# 460| dir = libcrun_get_state_directory (state_root, NULL);
# 461|-> if (UNLIKELY (dir == NULL))
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def529]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'open_rundir_dirfd'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:464:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(libcrun_get_state_directory(state_root, 0), 2686976)'
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
# 464|-> dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
# 465| if (UNLIKELY (dirfd < 0))
# 466| return crun_make_error (err, errno, "open `%s`", dir);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def530]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘open_rundir_dirfd’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:464:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(libcrun_get_state_directory(state_root, 0), 2686976)’
# 462| return crun_make_error (err, 0, "cannot get state directory");
# 463|
# 464|-> dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
# 465| if (UNLIKELY (dirfd < 0))
# 466| return crun_make_error (err, errno, "open `%s`", dir);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def531]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:465:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor '<unknown>'
# 463|
# 464| dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
# 465|-> if (UNLIKELY (dirfd < 0))
# 466| return crun_make_error (err, errno, "open `%s`", dir);
# 467|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def532]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:465:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘<unknown>’
# 463|
# 464| dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
# 465|-> if (UNLIKELY (dirfd < 0))
# 466| return crun_make_error (err, errno, "open `%s`", dir);
# 467|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def533]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:522:11: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(cache_dir_fd)'
# 520| int dfd;
# 521|
# 522|-> d = fdopendir (cache_dir_fd);
# 523| if (d == NULL)
# 524| return crun_make_error (err, errno, "cannot open seccomp cache directory");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def534]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:522:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(cache_dir_fd)’
# 520| int dfd;
# 521|
# 522|-> d = fdopendir (cache_dir_fd);
# 523| if (d == NULL)
# 524| return crun_make_error (err, errno, "cannot open seccomp cache directory");
Error: CLANG_WARNING: [#def535]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:526:7: warning[deadcode.DeadStores]: Value stored to 'cache_dir_fd' is never read
# 524| return crun_make_error (err, errno, "cannot open seccomp cache directory");
# 525| /* fdopendir owns the fd now. */
# 526|-> cache_dir_fd = -1;
# 527|
# 528| dfd = dirfd (d);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def536]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL 'entries' where non-null expected
crun-1.15-build/crun-1.15/src/libcrun/seccomp.h:22: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of 'qsort' must be non-null
# 560| }
# 561|
# 562|-> qsort (entries, n_entries, sizeof (struct cache_entry), compare_entries_by_atime);
# 563|
# 564| /* Attempt to delete half of them. */
Error: GCC_ANALYZER_WARNING (CWE-688): [#def537]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL ‘entries’ where non-null expected
crun-1.15-build/crun-1.15/src/libcrun/seccomp.h:22: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
# 560| }
# 561|
# 562|-> qsort (entries, n_entries, sizeof (struct cache_entry), compare_entries_by_atime);
# 563|
# 564| /* Attempt to delete half of them. */
Error: CLANG_WARNING: [#def538]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:562:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 560| }
# 561|
# 562|-> qsort (entries, n_entries, sizeof (struct cache_entry), compare_entries_by_atime);
# 563|
# 564| /* Attempt to delete half of them. */
Error: CPPCHECK_WARNING: [#def539]
crun-1.15-build/crun-1.15/src/libcrun/seccomp_notify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def540]
crun-1.15-build/crun-1.15/src/libcrun/seccomp_notify.c:105:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'b'
# 103|
# 104| b = xstrdup (plugins);
# 105|-> for (s = 0, it = strtok_r (b, ":", &saveptr); it; s++, it = strtok_r (NULL, ":", &saveptr))
# 106| {
# 107| run_oci_seccomp_notify_plugin_version_cb version_cb;
Error: CPPCHECK_WARNING: [#def541]
crun-1.15-build/crun-1.15/src/libcrun/signals.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def542]
crun-1.15-build/crun-1.15/src/libcrun/status.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.15-build/crun-1.15/src/libcrun/status.c:50:12: warning[-Wanalyzer-malloc-leak]: leak of 'get_run_directory(state_root)'
# 48| if (state_root)
# 49| root = xstrdup (state_root);
# 50|-> if (root == NULL)
# 51| {
# 52| const char *runtime_dir = getenv ("XDG_RUNTIME_DIR");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def544]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.15-build/crun-1.15/src/libcrun/status.c:50:12: warning[-Wanalyzer-malloc-leak]: leak of ‘get_run_directory(state_root)’
# 48| if (state_root)
# 49| root = xstrdup (state_root);
# 50|-> if (root == NULL)
# 51| {
# 52| const char *runtime_dir = getenv ("XDG_RUNTIME_DIR");
Error: GCC_ANALYZER_WARNING (CWE-775): [#def545]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'read_pid_stat'
crun-1.15-build/crun-1.15/src/libcrun/status.c:119:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&pid_stat_file, 524288)'
# 117| sprintf (pid_stat_file, "/proc/%d/stat", pid);
# 118|
# 119|-> fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC);
# 120| if (fd < 0)
# 121| {
Error: GCC_ANALYZER_WARNING (CWE-775): [#def546]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘read_pid_stat’
crun-1.15-build/crun-1.15/src/libcrun/status.c:119:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&pid_stat_file, 524288)’
# 117| sprintf (pid_stat_file, "/proc/%d/stat", pid);
# 118|
# 119|-> fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC);
# 120| if (fd < 0)
# 121| {
Error: CLANG_WARNING: [#def547]
crun-1.15-build/crun-1.15/src/libcrun/status.c:444:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'run_directory'
# 442| int ret;
# 443|
# 444|-> ret = crun_ensure_directory (run_directory, 0700, false, err);
# 445| if (UNLIKELY (ret < 0))
# 446| return ret;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def548]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'rmdirfd'
crun-1.15-build/crun-1.15/src/libcrun/status.c:473:7: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(fd)'
# 471| __attribute__ ((unused)) cleanup_close int fd_cleanup = fd;
# 472|
# 473|-> d = fdopendir (fd);
# 474| if (d == NULL)
# 475| return crun_make_error (err, errno, "cannot open directory `%s`", namedir);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def549]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘rmdirfd’
crun-1.15-build/crun-1.15/src/libcrun/status.c:473:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(fd)’
# 471| __attribute__ ((unused)) cleanup_close int fd_cleanup = fd;
# 472|
# 473|-> d = fdopendir (fd);
# 474| if (d == NULL)
# 475| return crun_make_error (err, errno, "cannot open directory `%s`", namedir);
Error: CLANG_WARNING: [#def550]
crun-1.15-build/crun-1.15/src/libcrun/status.c:515:15: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 513| return ret;
# 514|
# 515|-> ret = unlinkat (dirfd (d), de->d_name, AT_REMOVEDIR);
# 516| }
# 517| }
Error: GCC_ANALYZER_WARNING (CWE-775): [#def551]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.15-build/crun-1.15/src/libcrun/status.c:535:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(get_run_directory(state_root), 589824)'
# 533| return crun_make_error (err, 0, "cannot get state directory");
# 534|
# 535|-> rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_RDONLY | O_CLOEXEC));
# 536| if (UNLIKELY (rundir_dfd < 0))
# 537| return crun_make_error (err, errno, "cannot open run directory `%s`", dir);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def552]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.15-build/crun-1.15/src/libcrun/status.c:535:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(get_run_directory(state_root), 589824)’
# 533| return crun_make_error (err, 0, "cannot get state directory");
# 534|
# 535|-> rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_RDONLY | O_CLOEXEC));
# 536| if (UNLIKELY (rundir_dfd < 0))
# 537| return crun_make_error (err, errno, "cannot open run directory `%s`", dir);
Error: CLANG_WARNING: [#def553]
crun-1.15-build/crun-1.15/src/libcrun/status.c:546:3: warning[deadcode.DeadStores]: Value stored to 'dfd' is never read
# 544|
# 545| /* rmdirfd owns DFD. */
# 546|-> dfd = -1;
# 547|
# 548| if (UNLIKELY (ret < 0))
Error: CLANG_WARNING: [#def554]
crun-1.15-build/crun-1.15/src/libcrun/status.c:549:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'dir'
# 547|
# 548| if (UNLIKELY (ret < 0))
# 549|-> return ret;
# 550|
# 551| ret = unlinkat (rundir_dfd, id, AT_REMOVEDIR);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def555]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.15-build/crun-1.15/src/libcrun/status.c:556:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'rundir_dfd'
crun-1.15-build/crun-1.15/src/libcrun/error.h:42: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.c:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.c:22: included_from: Included from here.
# 554|
# 555| return 0;
# 556|-> }
# 557|
# 558| void
Error: GCC_ANALYZER_WARNING (CWE-775): [#def556]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.15-build/crun-1.15/src/libcrun/status.c:556:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rundir_dfd’
crun-1.15-build/crun-1.15/src/libcrun/error.h:42: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.c:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/status.c:22: included_from: Included from here.
# 554|
# 555| return 0;
# 556|-> }
# 557|
# 558| void
Error: GCC_ANALYZER_WARNING (CWE-401): [#def557]
crun-1.15-build/crun-1.15/src/libcrun/status.c:582:9: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(get_run_directory(state_root))'
# 580|
# 581| *ret = NULL;
# 582|-> dir = opendir (path);
# 583| if (UNLIKELY (dir == NULL))
# 584| return crun_make_error (err, errno, "cannot opendir `%s`", path);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def558]
crun-1.15-build/crun-1.15/src/libcrun/status.c:582:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(get_run_directory(state_root))’
# 580|
# 581| *ret = NULL;
# 582|-> dir = opendir (path);
# 583| if (UNLIKELY (dir == NULL))
# 584| return crun_make_error (err, errno, "cannot opendir `%s`", path);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def559]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.15-build/crun-1.15/src/libcrun/status.c:582:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
crun-1.15-build/crun-1.15/src/libcrun/utils.h:27: included_from: Included from here.
/usr/include/dirent.h:141:13: note: argument 1 of ‘opendir’ must be non-null
# 580|
# 581| *ret = NULL;
# 582|-> dir = opendir (path);
# 583| if (UNLIKELY (dir == NULL))
# 584| return crun_make_error (err, errno, "cannot opendir `%s`", path);
Error: CLANG_WARNING: [#def560]
crun-1.15-build/crun-1.15/src/libcrun/status.c:617:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 615| tmp = next_container;
# 616| }
# 617|-> *ret = tmp;
# 618| tmp = NULL;
# 619| return 0;
Error: GCC_ANALYZER_WARNING (CWE-775): [#def561]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'libcrun_status_create_exec_fifo'
crun-1.15-build/crun-1.15/src/libcrun/status.c:691:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 526336)'
# 689| return crun_make_error (err, errno, "mkfifo");
# 690|
# 691|-> fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC);
# 692| if (UNLIKELY (fd < 0))
# 693| return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def562]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_create_exec_fifo’
crun-1.15-build/crun-1.15/src/libcrun/status.c:691:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 526336)’
# 689| return crun_make_error (err, errno, "mkfifo");
# 690|
# 691|-> fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC);
# 692| if (UNLIKELY (fd < 0))
# 693| return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def563]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'libcrun_status_write_exec_fifo'
crun-1.15-build/crun-1.15/src/libcrun/status.c:713:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 524289)'
# 711| return ret;
# 712|
# 713|-> fd = open (fifo_path, O_WRONLY | O_CLOEXEC);
# 714| if (UNLIKELY (fd < 0))
# 715| return crun_make_error (err, errno, "cannot open `%s`", fifo_path);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def564]
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_write_exec_fifo’
crun-1.15-build/crun-1.15/src/libcrun/status.c:713:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 524289)’
# 711| return ret;
# 712|
# 713|-> fd = open (fifo_path, O_WRONLY | O_CLOEXEC);
# 714| if (UNLIKELY (fd < 0))
# 715| return crun_make_error (err, errno, "cannot open `%s`", fifo_path);
Error: CPPCHECK_WARNING: [#def565]
crun-1.15-build/crun-1.15/src/libcrun/terminal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def566]
crun-1.15-build/crun-1.15/src/libcrun/terminal.c:59:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 57|
# 58| ret = fd;
# 59|-> fd = -1;
# 60|
# 61| return ret;
Error: CPPCHECK_WARNING: [#def567]
crun-1.15-build/crun-1.15/src/libcrun/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def568]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:314:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp'
# 312| int ret;
# 313| cleanup_free char *tmp = xstrdup (path);
# 314|-> ret = ensure_directory_internal_at (dirfd, tmp, strlen (tmp), mode, err);
# 315| if (UNLIKELY (ret < 0))
# 316| return ret;
Error: CLANG_WARNING: [#def569]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:395:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 393|
# 394| ret = fd;
# 395|-> fd = -1;
# 396| return ret;
# 397| }
Error: CLANG_WARNING: [#def570]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:445:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp_buf'
# 443| size = readlinkat (dfd, name, tmp_buf, buf_size);
# 444| if (UNLIKELY (size < 0))
# 445|-> return crun_make_error (err, errno, "readlink `%s`", name);
# 446| } while (size == buf_size);
# 447|
Error: CLANG_WARNING: [#def571]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:587:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'cur'
# 585| }
# 586|
# 587|-> if (do_open)
# 588| {
# 589| if (cwd == dirfd)
Error: CLANG_WARNING: [#def572]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1089:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 1087|
# 1088| ret = fd;
# 1089|-> fd = -1;
# 1090|
# 1091| return ret;
Error: CLANG_WARNING: [#def573]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1123:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 1121|
# 1122| ret = fd;
# 1123|-> fd = -1;
# 1124|
# 1125| return ret;
Error: CLANG_WARNING: [#def574]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1272:3: warning[deadcode.DeadStores]: Value stored to 'epollfd' is never read
# 1270|
# 1271| ret = epollfd;
# 1272|-> epollfd = -1;
# 1273| return ret;
# 1274| }
Error: CLANG_WARNING: [#def575]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1429:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 1427| if (stream == NULL)
# 1428| {
# 1429|-> if (errno == ENOENT)
# 1430| goto exit;
# 1431|
Error: CLANG_WARNING: [#def576]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1444:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 1442| {
# 1443| if (errno == ENOENT)
# 1444|-> return 0;
# 1445|
# 1446| if (errno != ERANGE)
Error: CLANG_WARNING: [#def577]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1492:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 1490| if (LIKELY (ret == 0))
# 1491| {
# 1492|-> if (ret_pw)
# 1493| {
# 1494| name = ret_pw->pw_name;
Error: CLANG_WARNING: [#def578]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1773:3: warning[deadcode.DeadStores]: Value stored to 'cfd' is never read
# 1771|
# 1772| /* Now it is owned by dir. */
# 1773|-> cfd = -1;
# 1774|
# 1775| fd = dirfd (dir);
Error: CLANG_WARNING: [#def579]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1916:9: warning[deadcode.DeadStores]: Although the value stored to 'tmp' is used in the enclosing expression, the value is never actually read from 'tmp'
# 1914| }
# 1915|
# 1916|-> end = tmp = xstrdup (getenv ("PATH"));
# 1917|
# 1918| while ((it = strsep (&end, ":")))
Error: CLANG_WARNING: [#def580]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1925:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 1923| it = ".";
# 1924|
# 1925|-> len = snprintf (path, PATH_MAX, "%s/%s", it, executable_path);
# 1926| if (len == PATH_MAX)
# 1927| continue;
Error: CLANG_WARNING: [#def581]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2003:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buf'
# 2001| xattr_len = flistxattr (sfd, buf, xattr_len + 1);
# 2002| if (UNLIKELY (xattr_len < 0))
# 2003|-> return crun_make_error (err, errno, "get xattr list for `%s`", srcname);
# 2004|
# 2005| for (it = buf; it - buf < xattr_len; it += strlen (it) + 1)
Error: CLANG_WARNING: [#def582]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2024:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'it'
# 2022| }
# 2023|
# 2024|-> return 0;
# 2025| }
# 2026|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def583]
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2078:12: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(srcdirfd)'
# 2076| struct dirent *de;
# 2077|
# 2078|-> dsrcfd = fdopendir (srcdirfd);
# 2079| if (UNLIKELY (dsrcfd == NULL))
# 2080| {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def584]
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2078:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(srcdirfd)’
# 2076| struct dirent *de;
# 2077|
# 2078|-> dsrcfd = fdopendir (srcdirfd);
# 2079| if (UNLIKELY (dsrcfd == NULL))
# 2080| {
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def585]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2081:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcdirfd'
# 2079| if (UNLIKELY (dsrcfd == NULL))
# 2080| {
# 2081|-> TEMP_FAILURE_RETRY (close (srcdirfd));
# 2082| return crun_make_error (err, errno, "cannot open directory `%s`", destname);
# 2083| }
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def586]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2081:27: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘srcdirfd’
# 2079| if (UNLIKELY (dsrcfd == NULL))
# 2080| {
# 2081|-> TEMP_FAILURE_RETRY (close (srcdirfd));
# 2082| return crun_make_error (err, errno, "cannot open directory `%s`", destname);
# 2083| }
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def587]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2125:31: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
# 2123| #endif
# 2124|
# 2125|-> TEMP_FAILURE_RETRY (close (destfd));
# 2126| destfd = -1;
# 2127| break;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def588]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2125:31: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destfd’
# 2123| #endif
# 2124|
# 2125|-> TEMP_FAILURE_RETRY (close (destfd));
# 2126| destfd = -1;
# 2127| break;
Error: CLANG_WARNING: [#def589]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2126:11: warning[deadcode.DeadStores]: Value stored to 'destfd' is never read
# 2124|
# 2125| TEMP_FAILURE_RETRY (close (destfd));
# 2126|-> destfd = -1;
# 2127| break;
# 2128|
Error: CLANG_WARNING: [#def590]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2149:11: warning[deadcode.DeadStores]: Value stored to 'srcfd' is never read
# 2147|
# 2148| ret = copy_recursive_fd_to_fd (srcfd, destfd, de->d_name, de->d_name, err);
# 2149|-> srcfd = destfd = -1;
# 2150| if (UNLIKELY (ret < 0))
# 2151| return ret;
Error: CLANG_WARNING: [#def591]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2149:19: warning[deadcode.DeadStores]: Although the value stored to 'destfd' is used in the enclosing expression, the value is never actually read from 'destfd'
# 2147|
# 2148| ret = copy_recursive_fd_to_fd (srcfd, destfd, de->d_name, de->d_name, err);
# 2149|-> srcfd = destfd = -1;
# 2150| if (UNLIKELY (ret < 0))
# 2151| return ret;
Error: GCC_ANALYZER_WARNING (CWE-688): [#def592]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2159:17: warning[-Wanalyzer-null-argument]: use of NULL 'target_buf' where non-null expected
/usr/include/unistd.h:847:12: note: argument 1 of 'symlinkat' must be non-null
# 2157| return ret;
# 2158|
# 2159|-> ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2160| if (UNLIKELY (ret < 0))
# 2161| return crun_make_error (err, errno, "create symlink `%s/%s`", destname, de->d_name);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def593]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2159:17: warning[-Wanalyzer-null-argument]: use of NULL ‘target_buf’ where non-null expected
/usr/include/unistd.h:847:12: note: argument 1 of ‘symlinkat’ must be non-null
# 2157| return ret;
# 2158|
# 2159|-> ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2160| if (UNLIKELY (ret < 0))
# 2161| return crun_make_error (err, errno, "create symlink `%s/%s`", destname, de->d_name);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def594]
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'read_file_as_long_or_default'
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2484:9: warning[-Wanalyzer-null-argument]: use of NULL 'content' where non-null expected
/usr/include/features.h:511: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:22: included_from: Included from here.
/usr/include/stdlib.h:215:17: note: argument 1 of 'strtol' must be non-null
# 2482|
# 2483| errno = 0;
# 2484|-> val = strtol (content, &endptr, 10);
# 2485| if (UNLIKELY (errno))
# 2486| return def_value;
Error: GCC_ANALYZER_WARNING (CWE-688): [#def595]
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘read_file_as_long_or_default’
crun-1.15-build/crun-1.15/src/libcrun/utils.c:2484:9: warning[-Wanalyzer-null-argument]: use of NULL ‘content’ where non-null expected
/usr/include/features.h:511: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:22: included_from: Included from here.
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
# 2482|
# 2483| errno = 0;
# 2484|-> val = strtol (content, &endptr, 10);
# 2485| if (UNLIKELY (errno))
# 2486| return def_value;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def596]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'resctl_update'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'intelrdt_clean_l3_cache_schema(l3_cache_schema)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'safe_read_xattr'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(current_size + 1))'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def598]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'copy_xattr'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(xattr_len + 1))'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
crun-1.15-build/crun-1.15/src/libcrun/seccomp_notify.c:32: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_load_seccomp_notify_plugins'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def600]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif_resp)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((n_parts_a + 1) * 8)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def602]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(16)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(256)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def604]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'read_all_fd_with_size_hint'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(allocated + 1)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'read_all_fd_with_size_hint'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'write_controller_file'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(controllers_len + 1)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'copy_from_fd_to_fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(get_page_size())'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def607]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:25: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_copy_seccomp'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(in_size + 1)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def608]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(name_len + 2)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def609]
crun-1.15-build/crun-1.15/src/libcrun/intelrdt.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘resctl_update’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘intelrdt_clean_l3_cache_schema(l3_cache_schema)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def610]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘safe_read_xattr’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(current_size + 1))’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def611]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘copy_xattr’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(xattr_len + 1))’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def612]
crun-1.15-build/crun-1.15/src/libcrun/seccomp_notify.c:32: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_load_seccomp_notify_plugins’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif_resp)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((n_parts_a + 1) * 8)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def615]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘test_write_read_file’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(1024)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def616]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(16)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(256)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def618]
crun-1.15-build/crun-1.15/src/exec.c:29: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(88)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
/usr/include/bits/types/stack_t.h:23: included_from: Included from here.
/usr/include/signal.h:313: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:29: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
crun-1.15-build/crun-1.15/src/libcrun/utils.c:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘read_all_fd_with_size_hint’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(allocated + 1)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘read_all_fd_with_size_hint’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def620]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-utils.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘write_controller_file’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(controllers_len + 1)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def621]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘copy_from_fd_to_fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(get_page_size())’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def622]
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c:25: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_copy_seccomp’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(in_size + 1)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def623]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘append_systemd_annotation’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(name_len + 2)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 60| {
# 61| void *res = malloc (size);
# 62|-> if (UNLIKELY (res == NULL))
# 63| OOM ();
# 64| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def624]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file("config.json", err)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def625]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update_intel_rdt'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file(config_file, err)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def626]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_load_from_file'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'make_container(runtime_spec_schema_config_schema_parse_file(path, 0, & oci_error), path, 0)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def627]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0((num_mount_options + 1) * 8)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def628]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(120)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def629]
crun-1.15-build/crun-1.15/src/libcrun/container.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(144)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def630]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(176)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def631]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_cgroup_enter'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(24)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def632]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(48)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def633]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file("config.json", err)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update_intel_rdt’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file(config_file, err)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def635]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_load_from_file’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘make_container(runtime_spec_schema_config_schema_parse_file(path, 0, & oci_error), path, 0)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def636]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘make_oci_process_user(exec_options.user)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def637]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)(argc + 1) * 8)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def638]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((num_mount_options + 1) * 8)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def639]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(120)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def640]
crun-1.15-build/crun-1.15/src/libcrun/container.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(144)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def641]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(176)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def642]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_cgroup_enter’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(24)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def643]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(48)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def644]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘make_oci_process_user’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(56)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 69| {
# 70| void *res = calloc (1, size);
# 71|-> if (UNLIKELY (res == NULL))
# 72| OOM ();
# 73| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def645]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(buffer, (long unsigned int)(current_size + 1))'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def646]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'evict_cache'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 88)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def647]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_ebpf_load'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(log, log_size)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def648]
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'read_all_progs'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(progs, cur_size * 4)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def649]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'safe_readlinkat'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def650]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(buffer, (long unsigned int)(current_size + 1))’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def651]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘evict_cache’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(entries, (n_entries + 1) * 88)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def652]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_ebpf_load’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(log, log_size)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def653]
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘read_all_progs’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(progs, cur_size * 4)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def654]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘safe_readlinkat’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 78| {
# 79| void *res = realloc (ptr, size);
# 80|-> if (UNLIKELY (res == NULL))
# 81| OOM ();
# 82| return res;
Error: GCC_ANALYZER_WARNING (CWE-415): [#def655]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'buffer'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'safe_read_xattr'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def656]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'entries'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def657]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'log'
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: scope_hint: In function 'libcrun_ebpf_load'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def658]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'progs'
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: scope_hint: In function 'read_all_progs'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def659]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'tmp_buf'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'safe_readlinkat'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def660]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buffer’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘safe_read_xattr’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def661]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘entries’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def662]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘log’
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: scope_hint: In function ‘libcrun_ebpf_load’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def663]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘progs’
crun-1.15-build/crun-1.15/src/libcrun/ebpf.c: scope_hint: In function ‘read_all_progs’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-415): [#def664]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘tmp_buf’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘safe_readlinkat’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def665]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_restore'
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def666]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_restore’
# 87| {
# 88| void **pp = (void **) p;
# 89|-> free (*pp);
# 90| }
# 91|
Error: GCC_ANALYZER_WARNING (CWE-457): [#def667]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:104:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'read_all_file_at'
# 102| {
# 103| int *pp = (int *) p;
# 104|-> if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106| }
Error: GCC_ANALYZER_WARNING (CWE-457): [#def668]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:104:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘read_all_file_at’
# 102| {
# 103| int *pp = (int *) p;
# 104|-> if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106| }
Error: COMPILER_WARNING (CWE-457): [#def669]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:104:7: warning[-Wmaybe-uninitialized]: 'fd' may be used uninitialized
# 104 | if (*pp >= 0)
# | ^~~
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'read_all_file_at'
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1040:21: note: 'fd' declared here
# 1040 | cleanup_close int fd;
# | ^~
# 102| {
# 103| int *pp = (int *) p;
# 104|-> if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106| }
Error: COMPILER_WARNING (CWE-457): [#def670]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:104:7: warning[-Wmaybe-uninitialized]: ‘fd’ may be used uninitialized
# 104 | if (*pp >= 0)
# | ^~~
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘read_all_file_at’
crun-1.15-build/crun-1.15/src/libcrun/utils.c:1040:21: note: ‘fd’ declared here
# 1040 | cleanup_close int fd;
# | ^~
# 102| {
# 103| int *pp = (int *) p;
# 104|-> if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106| }
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def671]
crun-1.15-build/crun-1.15/src/libcrun/error.h:42: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/container.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*(void *)p'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def672]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def673]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def674]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cgroup_dirfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def675]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'console_socket_fd'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def676]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destdirfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def677]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def678]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def679]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_cpuset'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def680]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_htlb'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def681]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netclass'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def682]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netprio'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def683]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def684]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd_cleanup'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def685]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'image_fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def686]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/seccomp.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def687]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'root_fd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def688]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rootfsfd_cleanup'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def689]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'signalfd'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def690]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def691]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'wfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def692]
crun-1.15-build/crun-1.15/src/libcrun/error.h:42: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/container.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘*(void *)p’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def693]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘<unknown>’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def694]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘cfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/status.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def695]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘cgroup_dirfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def696]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘console_socket_fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def697]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destdirfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def698]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def699]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_cpuset’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def700]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_htlb’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def701]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_netclass’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def702]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_netprio’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def703]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def704]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd1’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def705]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd_cleanup’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def706]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def707]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘image_fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def708]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/seccomp.h:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def709]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘outfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def710]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def711]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def712]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘root_fd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def713]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘rootfsfd_cleanup’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def714]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘signalfd’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def715]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘srcfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def716]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘wfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
# 103| int *pp = (int *) p;
# 104| if (*pp >= 0)
# 105|-> TEMP_FAILURE_RETRY (close (*pp));
# 106| }
# 107|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def717]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_set_stdio'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:106:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'ret'
# 104| if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106|-> }
# 107|
# 108| static inline void
Error: GCC_ANALYZER_WARNING (CWE-775): [#def718]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_set_stdio’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:106:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
# 104| if (*pp >= 0)
# 105| TEMP_FAILURE_RETRY (close (*pp));
# 106|-> }
# 107|
# 108| static inline void
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def719]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def720]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'own_seccomp_receiver_fd'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def721]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_fd'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def722]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_receiver_fd'
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def723]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'terminal_fd'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def724]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def725]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘own_seccomp_receiver_fd’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def726]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘seccomp_fd’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def727]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘seccomp_receiver_fd’
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def728]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘terminal_fd’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
# 205| if (*fd >= 0)
# 206| {
# 207|-> ret = TEMP_FAILURE_RETRY (close (*fd));
# 208| if (LIKELY (ret == 0))
# 209| *fd = -1;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def729]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup("1.0.0")'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def730]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup("1.1.0+dev")'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def731]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&*next.d_name)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def732]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_new_terminal'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&buf)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def733]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*<unknown>.name)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def734]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_70->process.selinux_label)'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def735]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_75->process.apparmor_profile)'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def736]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore_linux_criu'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*status.bundle)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def737]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(<unknown>)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def738]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(executable_path)'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'find_executable'
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function 'find_executable'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def739]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'read_unified_cgroup_pid'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(from)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def740]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'find_executable'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(getenv("PATH"))'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def741]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(name)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def742]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(plugins)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def743]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(t)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def744]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(value + 1)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def745]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(value)'
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def746]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup("1.0.0")’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def747]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup("1.1.0+dev")’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def748]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(&*next.d_name)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def749]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_new_terminal’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(&buf)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def750]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*<unknown>)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def751]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*<unknown>.name)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def752]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_70->process.selinux_label)’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def753]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_75->process.apparmor_profile)’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.15-build/crun-1.15/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def754]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore_linux_criu’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*status.bundle)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def755]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(<unknown>)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def756]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(exec_options.apparmor)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def757]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(exec_options.process_label)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def758]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(executable_path)’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘find_executable’
crun-1.15-build/crun-1.15/src/libcrun/utils.c: scope_hint: In function ‘find_executable’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def759]
crun-1.15-build/crun-1.15/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/cgroup-setup.c:23: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘read_unified_cgroup_pid’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(from)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def760]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘find_executable’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(getenv("PATH"))’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def761]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(name)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:24: included_from: Included from here.
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def762]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(plugins)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def763]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(t)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def764]
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(value + 1)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def765]
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘append_systemd_annotation’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(value)’
# 220|
# 221| ret = strdup (str);
# 222|-> if (ret == NULL)
# 223| OOM ();
# 224|
Error: CPPCHECK_WARNING: [#def766]
crun-1.15-build/crun-1.15/src/list.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def767]
crun-1.15-build/crun-1.15/src/oci_features.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def768]
crun-1.15-build/crun-1.15/src/oci_features.c:73:9: warning[deadcode.DeadStores]: Value stored to 'val' during its initialization is never read
# 71| add_bool_str_to_json (yajl_gen json_gen, const char *key, int value)
# 72| {
# 73|-> char *val = "";
# 74| if (value)
# 75| {
Error: CPPCHECK_WARNING: [#def769]
crun-1.15-build/crun-1.15/src/pause.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def770]
crun-1.15-build/crun-1.15/src/ps.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def771]
crun-1.15-build/crun-1.15/src/restore.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def772]
crun-1.15-build/crun-1.15/src/run.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def773]
crun-1.15-build/crun-1.15/src/run.c:156:14: warning[deadcode.DeadStores]: Although the value stored to 'bundle_cleanup' is used in the enclosing expression, the value is never actually read from 'bundle_cleanup'
# 154| /* Make sure the bundle is an absolute path. */
# 155| if (bundle == NULL)
# 156|-> bundle = bundle_cleanup = getcwd (NULL, 0);
# 157| else
# 158| {
Error: CLANG_WARNING: [#def774]
crun-1.15-build/crun-1.15/src/run.c:182:33: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 180| if (getenv ("LISTEN_FDS"))
# 181| {
# 182|-> crun_context.listen_fds = strtoll (getenv ("LISTEN_FDS"), NULL, 10);
# 183| crun_context.preserve_fds += crun_context.listen_fds;
# 184| }
Error: CPPCHECK_WARNING: [#def775]
crun-1.15-build/crun-1.15/src/spec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def776]
crun-1.15-build/crun-1.15/src/spec.c: scope_hint: In function ‘crun_command_spec’
crun-1.15-build/crun-1.15/src/spec.c:126:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(<unknown>, "w+e")’
# 124| }
# 125|
# 126|-> f = fopen (where, "w+e");
# 127| if (f == NULL)
# 128| return libcrun_make_error (err, errno, "cannot open `%s`", where);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def777]
crun-1.15-build/crun-1.15/src/spec.c:126:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(<unknown>, "w+e")’
# 124| }
# 125|
# 126|-> f = fopen (where, "w+e");
# 127| if (f == NULL)
# 128| return libcrun_make_error (err, errno, "cannot open `%s`", where);
Error: CPPCHECK_WARNING: [#def778]
crun-1.15-build/crun-1.15/src/start.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def779]
crun-1.15-build/crun-1.15/src/state.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def780]
crun-1.15-build/crun-1.15/src/unpause.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def781]
crun-1.15-build/crun-1.15/src/update.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def782]
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘write_to’
crun-1.15-build/crun-1.15/tests/init.c:165:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 1)’
# 163| error (EXIT_FAILURE, errno, "open `%s`", path);
# 164|
# 165|-> if (write (fd, str, strlen (str)) < 0)
# 166| error (EXIT_FAILURE, errno, "write to `%s`", path);
# 167| if (close (fd) < 0)
Error: GCC_ANALYZER_WARNING (CWE-775): [#def783]
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘check_idmapped_mounts’
crun-1.15-build/crun-1.15/tests/init.c:209:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&proc_path, 0)’
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘check_idmapped_mounts’
# 207| open_tree_fd = syscall_open_tree (-1, path,
# 208| AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | OPEN_TREE_CLOEXEC | OPEN_TREE_CLONE);
# 209|-> if (open_tree_fd < 0)
# 210| error (EXIT_FAILURE, errno, "open `%s`", path);
# 211|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def784]
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘cat’
crun-1.15-build/crun-1.15/tests/init.c:241:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "rbe")’
# 239| error (EXIT_FAILURE, errno, "fread");
# 240| }
# 241|-> s = fwrite (buf, 1, s, stdout);
# 242| if (s == 0)
# 243| error (EXIT_FAILURE, errno, "fwrite");
Error: GCC_ANALYZER_WARNING (CWE-401): [#def785]
crun-1.15-build/crun-1.15/tests/init.c:241:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "rbe")’
# 239| error (EXIT_FAILURE, errno, "fread");
# 240| }
# 241|-> s = fwrite (buf, 1, s, stdout);
# 242| if (s == 0)
# 243| error (EXIT_FAILURE, errno, "fwrite");
Error: COMPILER_WARNING: [#def786]
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘main’
crun-1.15-build/crun-1.15/tests/init.c:305:3: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 108 equals destination size
# 305 | strncpy (notify_socket_unix_name.sun_path, notify_socket_name,
# | ^
# 303|
# 304| notify_socket_unix_name.sun_family = AF_UNIX;
# 305|-> strncpy (notify_socket_unix_name.sun_path, notify_socket_name,
# 306| sizeof (notify_socket_unix_name.sun_path));
# 307|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def787]
crun-1.15-build/crun-1.15/tests/init.c: scope_hint: In function ‘main’
crun-1.15-build/crun-1.15/tests/init.c:582:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 1)’
# 580| error (EXIT_FAILURE, errno, "open `%s`", path);
# 581| ret = write (fd, "1", 1);
# 582|-> if (ret < 0)
# 583| error (EXIT_FAILURE, errno, "open `%s`", path);
# 584| close (fd);
Error: CPPCHECK_WARNING: [#def788]
crun-1.15-build/crun-1.15/tests/tests_libcrun_errors.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def789]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def790]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘test_generate_ebpf’
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:105:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘test_generate_ebpf’
# 103| program = new_program;
# 104|
# 105|-> fd = open ("/dev/null", O_WRONLY);
# 106| if (fd < 0)
# 107| return 0;
Error: CLANG_WARNING: [#def791]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:127:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 125|
# 126| chroot_realpath (".", path, resolved_path);
# 127|-> (void) resolved_path;
# 128| return 0;
# 129| }
Error: CLANG_WARNING: [#def792]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:141:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'name'
# 139|
# 140| str2sig (name);
# 141|-> return 0;
# 142| }
# 143|
Error: CLANG_WARNING: [#def793]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:157:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'conf'
# 155| return 0;
# 156|
# 157|-> container = libcrun_container_load_from_memory (conf, &err);
# 158| if (container == NULL)
# 159| {
Error: GCC_ANALYZER_WARNING (CWE-775): [#def794]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘generate_seccomp’
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:164:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
# 162| }
# 163|
# 164|-> outfd = open ("/dev/null", O_WRONLY);
# 165| if (outfd < 0)
# 166| return 0;
Error: CLANG_WARNING: [#def795]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:188:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 186|
# 187| libcrun_cgroup_read_pids_from_path (path, true, &pids, &err);
# 188|-> crun_error_release (&err);
# 189| return 0;
# 190| }
Error: CLANG_WARNING: [#def796]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:215:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 213| crun_error_release (&err);
# 214|
# 215|-> return 0;
# 216| }
# 217|
Error: CLANG_WARNING: [#def797]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:243:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'path'
# 241| crun_error_release (&err);
# 242|
# 243|-> return 0;
# 244| }
# 245|
Error: CLANG_WARNING: [#def798]
crun-1.15-build/crun-1.15/tests/tests_libcrun_fuzzer.c:331:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'conf'
# 329| return 0;
# 330|
# 331|-> container = libcrun_container_load_from_memory (conf, &err);
# 332| if (container == NULL)
# 333| {
Error: CPPCHECK_WARNING: [#def799]
crun-1.15-build/crun-1.15/tests/tests_libcrun_intelrdt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def800]
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def801]
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c:108:7: warning[deadcode.DeadStores]: Value stored to 'fd0' is never read
# 106|
# 107| close (fd0);
# 108|-> fd0 = -1;
# 109|
# 110| if (send_fd_to_socket (fd1, pipefd0, &err) < 0)
Error: CLANG_WARNING: [#def802]
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c:133:7: warning[deadcode.DeadStores]: Value stored to 'fd1' is never read
# 131|
# 132| close (fd1);
# 133|-> fd1 = -1;
# 134|
# 135| ret = read (fd, buffer, sizeof (buffer));
Error: GCC_ANALYZER_WARNING (CWE-775): [#def803]
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c: scope_hint: In function ‘test_send_receive_fd’
crun-1.15-build/crun-1.15/tests/tests_libcrun_utils.c:144:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipes[1]’
# 142| }
# 143| return 0;
# 144|-> }
# 145|
# 146| static int
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-235.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | crun-1.15-1.fc41 |
store-results-to | /tmp/tmpdouv5jsl/crun-1.15-1.fc41.tar.xz |
time-created | 2024-07-03 12:17:18 |
time-finished | 2024-07-03 12:22:11 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpdouv5jsl/crun-1.15-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpdouv5jsl/crun-1.15-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |