Task #508 - crun-1.14.4-1.fc40/scan-results.err
back to task #508download
Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'make_basic_test_double_array' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:50:16: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'basic_test_double_array_parse_data' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:378:53: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.strarrays_item_lens + i * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array' # 376| { # 377| size_t j; # 378|-> for (j = 0; j < ptr->strarrays_item_lens[i]; j++) # 379| { # 380| free (ptr->strarrays[i][j]); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:495:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 493| GEN_SET_ERROR_AND_RETURN (stat, err); # 494| } # 495|-> stat = yajl_gen_array_close ((yajl_gen) g); # 496| } # 497| stat = yajl_gen_array_close ((yajl_gen) g); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:528:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 526| GEN_SET_ERROR_AND_RETURN (stat, err); # 527| } # 528|-> stat = yajl_gen_array_close ((yajl_gen) g); # 529| } # 530| stat = yajl_gen_array_close ((yajl_gen) g); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:561:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 559| GEN_SET_ERROR_AND_RETURN (stat, err); # 560| } # 561|-> stat = yajl_gen_array_close ((yajl_gen) g); # 562| } # 563| stat = yajl_gen_array_close ((yajl_gen) g); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:594:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 592| GEN_SET_ERROR_AND_RETURN (stat, err); # 593| } # 594|-> stat = yajl_gen_array_close ((yajl_gen) g); # 595| } # 596| stat = yajl_gen_array_close ((yajl_gen) g); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array.c:627:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 625| GEN_SET_ERROR_AND_RETURN (stat, err); # 626| } # 627|-> stat = yajl_gen_array_close ((yajl_gen) g); # 628| } # 629| stat = yajl_gen_array_close ((yajl_gen) g); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_data' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_int_container_parse_data(fread_file(stream, & filesize), ctx, err)' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:163:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_data' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:35: error[memleak]: Memory leak: ptr # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:35:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_data' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:39:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 37| # 38| # 39|-> for (i = 0; i < alen; i++) # 40| { # 41| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i]; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:163:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c:163:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' # 161| } # 162| # 163|-> define_cleaner_function (yajl_val, yajl_tree_free) # 164| # 165| basic_test_top_array_int_container * Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_string_container_parse_data(fread_file(stream, & filesize), ctx, err)' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c:156:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c:35: error[memleak]: Memory leak: ptr # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_array_string.c:35:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_int_container_parse_data(fread_file(stream, & filesize), ctx, err)' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:186:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:35: error[memleak]: Memory leak: ptr # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:35:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:39: error[memleak]: Memory leak: ptr # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); # 38| if (ptr->subitem_lens == NULL) # 39|-> return NULL; # 40| # 41| for (i = 0; i < alen; i++) Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:41:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 39| return NULL; # 40| # 41|-> for (i = 0; i < alen; i++) # 42| { # 43| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i]; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:128:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 126| GEN_SET_ERROR_AND_RETURN (stat, err); # 127| } # 128|-> stat = yajl_gen_array_close ((yajl_gen) g); # 129| # 130| Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:186:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_int.c:186:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' # 184| } # 185| # 186|-> define_cleaner_function (yajl_val, yajl_tree_free) # 187| # 188| basic_test_top_double_array_int_container * Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'make_basic_test_top_double_array_obj_container' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:165: error[memleak]: Memory leak: ptr # 163| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 164| if (ptr->items == NULL) # 165|-> return NULL; # 166| ptr->len = alen; # 167| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:165:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 163| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 164| if (ptr->items == NULL) # 165|-> return NULL; # 166| ptr->len = alen; # 167| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:169: error[memleak]: Memory leak: ptr # 167| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); # 168| if (ptr->subitem_lens == NULL) # 169|-> return NULL; # 170| # 171| for (i = 0; i < alen; i++) Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:203:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:8: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0' # 201| { # 202| size_t j; # 203|-> for (j = 0; j < ptr->subitem_lens[i]; j++) # 204| { # 205| free_basic_test_top_double_array_obj_element (ptr->items[i][j]); Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:205:15: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0' # 203| for (j = 0; j < ptr->subitem_lens[i]; j++) # 204| { # 205|-> free_basic_test_top_double_array_obj_element (ptr->items[i][j]); # 206| ptr->items[i][j] = NULL; # 207| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_obj.c:250:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 248| GEN_SET_ERROR_AND_RETURN (stat, err); # 249| } # 250|-> stat = yajl_gen_array_close ((yajl_gen) g); # 251| # 252| Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_refobj_container_parse_data(fread_file(stream, & filesize), ctx, err)' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:178:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_refobj_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx, err)' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:35: error[memleak]: Memory leak: ptr # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:35:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:39: error[memleak]: Memory leak: ptr # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); # 38| if (ptr->subitem_lens == NULL) # 39|-> return NULL; # 40| # 41| for (i = 0; i < alen; i++) Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:41:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 39| return NULL; # 40| # 41|-> for (i = 0; i < alen; i++) # 42| { # 43| yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i]; Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:73:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0' # 71| { # 72| size_t j; # 73|-> for (j = 0; j < ptr->subitem_lens[i]; j++) # 74| { # 75| free_basic_test_double_array_item (ptr->items[i][j]); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:120:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 118| GEN_SET_ERROR_AND_RETURN (stat, err); # 119| } # 120|-> stat = yajl_gen_array_close ((yajl_gen) g); # 121| # 122| Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:178:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:178:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' # 176| } # 177| # 178|-> define_cleaner_function (yajl_val, yajl_tree_free) # 179| # 180| basic_test_top_double_array_refobj_container * Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:24:14: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_string_container_parse_data(fread_file(stream, & filesize), ctx, err)' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:183:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'basic_test_top_double_array_string_container_parse_file_stream' # 22| (void) ctx; # 23| # 24|-> if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL) # 25| return NULL; # 26| *err = NULL; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:35: error[memleak]: Memory leak: ptr # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:35:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 33| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 34| if (ptr->items == NULL) # 35|-> return NULL; # 36| ptr->len = alen; # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:39: error[memleak]: Memory leak: ptr # 37| ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t)); # 38| if (ptr->subitem_lens == NULL) # 39|-> return NULL; # 40| # 41| for (i = 0; i < alen; i++) Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:78:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0' # 76| { # 77| size_t j; # 78|-> for (j = 0; j < ptr->subitem_lens[i]; j++) # 79| { # 80| free (ptr->items[i][j]); Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:80:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0' # 78| for (j = 0; j < ptr->subitem_lens[i]; j++) # 79| { # 80|-> free (ptr->items[i][j]); # 81| ptr->items[i][j] = NULL; # 82| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/basic_test_top_double_array_string.c:125:13: warning[deadcode.DeadStores]: Value stored to 'stat' is never read # 123| GEN_SET_ERROR_AND_RETURN (stat, err); # 124| } # 125|-> stat = yajl_gen_array_close ((yajl_gen) g); # 126| # 127| Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:106:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:267: error[memleak]: Memory leak: ptr # 265| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 266| if (ptr->items == NULL) # 267|-> return NULL; # 268| ptr->len = alen; # 269| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:267:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ptr' # 265| ptr->items = calloc (alen + 1, sizeof(*ptr->items)); # 266| if (ptr->items == NULL) # 267|-> return NULL; # 268| ptr->len = alen; # 269| Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c: scope_hint: In function 'make_image_spec_schema_config_schema' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:182:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:533:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 531| if (ret->diff_ids == NULL) # 532| { # 533|-> if (asprintf (err, "Required field '%s' not present", "diff_ids") < 0) # 534| *err = strdup ("error allocating memory"); # 535| return NULL; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:562:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 560| { # 561| yajl_tree_free (resi); # 562|-> return NULL; # 563| } # 564| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:703:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 701| ret->created = strdup (str ? str : ""); # 702| if (ret->created == NULL) # 703|-> return NULL; # 704| } # 705| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:749:38: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 747| { # 748| ret->empty_layer = YAJL_IS_TRUE(val); # 749|-> ret->empty_layer_present = 1; # 750| } # 751| else Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:877:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 875| ret->created = strdup (str ? str : ""); # 876| if (ret->created == NULL) # 877|-> return NULL; # 878| } # 879| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_config_schema.c:1032:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1030| { # 1031| yajl_tree_free (resi); # 1032|-> return NULL; # 1033| } # 1034| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: scope_hint: In function 'image_spec_schema_content_descriptor_parse_data' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:151:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_content_descriptor.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_defs.c:115:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_defs.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_defs.c:8: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:111:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_index_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_index_schema.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: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:562:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 560| if (! YAJL_IS_NUMBER (val)) # 561| { # 562|-> *err = strdup ("invalid type"); # 563| return NULL; # 564| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:653:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 651| { # 652| yajl_tree_free (resi); # 653|-> return NULL; # 654| } # 655| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: scope_hint: In function 'image_spec_schema_image_layout_schema_parse_data' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_layout_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_data' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:183:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 181| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 182| } # 183|-> if (ctx->options & OPT_PARSE_FULLKEY) # 184| ret->_residual = resi; # 185| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'make_image_spec_schema_image_manifest_schema' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:183:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:8: included_from: Included from here. # 181| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 182| } # 183|-> if (ctx->options & OPT_PARSE_FULLKEY) # 184| ret->_residual = resi; # 185| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.c:1480:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*map.values' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.c:1486:1: note: in expansion of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux_resources' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:311:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 309| while (0); # 310| # 311|-> if (tree->type == yajl_t_object) # 312| { # 313| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:311:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx, err)' # 309| while (0); # 310| # 311|-> if (tree->type == yajl_t_object) # 312| { # 313| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1816:30: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources(get_val(tree, "resources", 3), ctx, err)' # 1814| while (0); # 1815| ret->pids = make_runtime_spec_schema_config_linux_resources_pids (get_val (tree, "pids", yajl_t_object), ctx, err); # 1816|-> if (ret->pids == NULL && *err != 0) # 1817| return NULL; # 1818| 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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2273:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here. # 2271| } # 2272| # 2273|-> if (tree->type == yajl_t_object) # 2274| { # 2275| size_t i; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2793: error[memleak]: Memory leak: ret # 2791| ret->boottime = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "boottime", yajl_t_object), ctx, err); # 2792| if (ret->boottime == NULL && *err != 0) # 2793|-> return NULL; # 2794| ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err); # 2795| if (ret->monotonic == NULL && *err != 0) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2796: error[memleak]: Memory leak: ret # 2794| ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err); # 2795| if (ret->monotonic == NULL && *err != 0) # 2796|-> return NULL; # 2797| # 2798| if (tree->type == yajl_t_object) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2809: error[memleak]: Memory leak: ret # 2807| resi = calloc (1, sizeof(*tree)); # 2808| if (resi == NULL) # 2809|-> return NULL; # 2810| # 2811| resi->type = yajl_t_object; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2816: error[memleak]: Memory leak: ret # 2814| { # 2815| yajl_tree_free (resi); # 2816|-> return NULL; # 2817| } # 2818| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2822: error[memleak]: Memory leak: ret # 2820| { # 2821| yajl_tree_free (resi); # 2822|-> return NULL; # 2823| } # 2824| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:531:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:8: included_from: Included from here. # 529| } # 530| # 531|-> if (tree->type == yajl_t_object) # 532| { # 533| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema_process' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:701:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_console_size(get_val(tree, "consoleSize", 3), ctx, err)' # 699| while (0); # 700| # 701|-> if (tree->type == yajl_t_object) # 702| { # 703| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:937:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 935| while (0); # 936| # 937|-> if (tree->type == yajl_t_object) # 938| { # 939| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:937:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx, err)' # 935| while (0); # 936| # 937|-> if (tree->type == yajl_t_object) # 938| { # 939| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1248:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 1246| while (0); # 1247| # 1248|-> if (tree->type == yajl_t_object) # 1249| { # 1250| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1248:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx, err)' # 1246| while (0); # 1247| # 1248|-> if (tree->type == yajl_t_object) # 1249| { # 1250| size_t i; Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'make_runtime_spec_schema_config_solaris' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:156:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 154| ret->physical = strdup (str ? str : ""); # 155| if (ret->physical == NULL) # 156|-> return NULL; # 157| } # 158| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:173:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:8: included_from: Included from here. # 171| while (0); # 172| # 173|-> if (tree->type == yajl_t_object) # 174| { # 175| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:173:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx, err)' # 171| while (0); # 172| # 173|-> if (tree->type == yajl_t_object) # 174| { # 175| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:191:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 189| { # 190| yajl_tree_free (resi); # 191|-> return NULL; # 192| } # 193| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:307:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 305| ret->linkname = strdup (str ? str : ""); # 306| if (ret->linkname == NULL) # 307|-> return NULL; # 308| } # 309| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:374:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 372| { # 373| yajl_val val = get_val (tree, "linkProtection", yajl_t_string); # 374|-> if (val != NULL) # 375| { # 376| char *str = YAJL_GET_STRING (val); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:374:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val, ctx, err)' # 372| { # 373| yajl_val val = get_val (tree, "linkProtection", yajl_t_string); # 374|-> if (val != NULL) # 375| { # 376| char *str = YAJL_GET_STRING (val); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:527:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 525| ret->milestone = strdup (str ? str : ""); # 526| if (ret->milestone == NULL) # 527|-> return NULL; # 528| } # 529| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:602:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 600| { # 601| yajl_tree_free (resi); # 602|-> return NULL; # 603| } # 604| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:69:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:272:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 270| if (ret->path == NULL) # 271| { # 272|-> if (asprintf (err, "Required field '%s' not present", "path") < 0) # 273| *err = strdup ("error allocating memory"); # 274| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:277:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 275| } # 276| # 277|-> if (tree->type == yajl_t_object) # 278| { # 279| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:295:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 293| { # 294| yajl_tree_free (resi); # 295|-> return NULL; # 296| } # 297| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:469:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 467| if (ret->path == NULL) # 468| { # 469|-> if (asprintf (err, "Required field '%s' not present", "path") < 0) # 470| *err = strdup ("error allocating memory"); # 471| return NULL; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:498:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 496| { # 497| yajl_tree_free (resi); # 498|-> return NULL; # 499| } # 500| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:608: error[memleak]: Memory leak: ret # 606| ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err); # 607| if (ret->hypervisor == NULL && *err != 0) # 608|-> return NULL; # 609| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err); # 610| if (ret->kernel == NULL && *err != 0) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:608:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 606| ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err); # 607| if (ret->hypervisor == NULL && *err != 0) # 608|-> return NULL; # 609| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err); # 610| if (ret->kernel == NULL && *err != 0) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:611: error[memleak]: Memory leak: ret # 609| ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err); # 610| if (ret->kernel == NULL && *err != 0) # 611|-> return NULL; # 612| ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err); # 613| if (ret->image == NULL && *err != 0) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:614: error[memleak]: Memory leak: ret # 612| ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err); # 613| if (ret->image == NULL && *err != 0) # 614|-> return NULL; # 615| if (ret->kernel == NULL) # 616| { Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:619: error[memleak]: Memory leak: ret # 617| if (asprintf (err, "Required field '%s' not present", "kernel") < 0) # 618| *err = strdup ("error allocating memory"); # 619|-> return NULL; # 620| } # 621| Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:633: error[memleak]: Memory leak: ret # 631| resi = calloc (1, sizeof(*tree)); # 632| if (resi == NULL) # 633|-> return NULL; # 634| # 635| resi->type = yajl_t_object; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:640:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 638| { # 639| yajl_tree_free (resi); # 640|-> return NULL; # 641| } # 642| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:646: error[memleak]: Memory leak: ret # 644| { # 645| yajl_tree_free (resi); # 646|-> return NULL; # 647| } # 648| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources' crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:164:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 162| if (! YAJL_IS_NUMBER (val)) # 163| { # 164|-> *err = strdup ("invalid type"); # 165| return NULL; # 166| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:223:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx, err)' # 221| while (0); # 222| # 223|-> if (tree->type == yajl_t_object) # 224| { # 225| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:241:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 239| { # 240| yajl_tree_free (resi); # 241|-> return NULL; # 242| } # 243| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_cpu' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:273:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 271| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 272| } # 273|-> if (ctx->options & OPT_PARSE_FULLKEY) # 274| ret->_residual = resi; # 275| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:273:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 271| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 272| } # 273|-> if (ctx->options & OPT_PARSE_FULLKEY) # 274| ret->_residual = resi; # 275| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:366:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 364| if (! YAJL_IS_NUMBER (val)) # 365| { # 366|-> *err = strdup ("invalid type"); # 367| return NULL; # 368| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:425:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_storage(get_val(tree, "storage", 3), ctx, err)' # 423| while (0); # 424| # 425|-> if (tree->type == yajl_t_object) # 426| { # 427| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:443:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 441| { # 442| yajl_tree_free (resi); # 443|-> return NULL; # 444| } # 445| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:475:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 473| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 474| } # 475|-> if (ctx->options & OPT_PARSE_FULLKEY) # 476| ret->_residual = resi; # 477| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_storage' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:475:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 473| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 474| } # 475|-> if (ctx->options & OPT_PARSE_FULLKEY) # 476| ret->_residual = resi; # 477| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:561:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx, err)' # 559| return NULL; # 560| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err); # 561|-> if (ret->memory == NULL && *err != 0) # 562| return NULL; # 563| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:562: error[memleak]: Memory leak: ret # 560| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err); # 561| if (ret->memory == NULL && *err != 0) # 562|-> return NULL; # 563| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err); # 564| if (ret->cpu == NULL && *err != 0) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:562:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 560| ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err); # 561| if (ret->memory == NULL && *err != 0) # 562|-> return NULL; # 563| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err); # 564| if (ret->cpu == NULL && *err != 0) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:565: error[memleak]: Memory leak: ret # 563| ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err); # 564| if (ret->cpu == NULL && *err != 0) # 565|-> return NULL; # 566| ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err); # 567| if (ret->storage == NULL && *err != 0) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:568: error[memleak]: Memory leak: ret # 566| ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err); # 567| if (ret->storage == NULL && *err != 0) # 568|-> return NULL; # 569| # 570| if (tree->type == yajl_t_object) Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:581: error[memleak]: Memory leak: ret # 579| resi = calloc (1, sizeof(*tree)); # 580| if (resi == NULL) # 581|-> return NULL; # 582| # 583| resi->type = yajl_t_object; Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:588:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 586| { # 587| yajl_tree_free (resi); # 588|-> return NULL; # 589| } # 590| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:594: error[memleak]: Memory leak: ret # 592| { # 593| yajl_tree_free (resi); # 594|-> return NULL; # 595| } # 596| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:722:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 720| ret->endpoint_list = calloc (len + 1, sizeof (*ret->endpoint_list)); # 721| if (ret->endpoint_list == NULL) # 722|-> return NULL; # 723| for (i = 0; i < len; i++) # 724| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:825:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 823| { # 824| yajl_tree_free (resi); # 825|-> return NULL; # 826| } # 827| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1077:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1075| ret->utility_vm_path = strdup (str ? str : ""); # 1076| if (ret->utility_vm_path == NULL) # 1077|-> return NULL; # 1078| } # 1079| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1100:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1098| { # 1099| yajl_tree_free (resi); # 1100|-> return NULL; # 1101| } # 1102| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1243:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1241| ret->resources = make_runtime_spec_schema_config_windows_resources (get_val (tree, "resources", yajl_t_object), ctx, err); # 1242| if (ret->resources == NULL && *err != 0) # 1243|-> return NULL; # 1244| ret->network = make_runtime_spec_schema_config_windows_network (get_val (tree, "network", yajl_t_object), ctx, err); # 1245| if (ret->network == NULL && *err != 0) Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:329:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 327| if (! YAJL_IS_NUMBER (val)) # 328| { # 329|-> *err = strdup ("invalid type"); # 330| return NULL; # 331| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_mount' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:388:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_id_mapping(val, ctx, err)' # 386| while (0); # 387| # 388|-> if (tree->type == yajl_t_object) # 389| { # 390| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:406:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 404| { # 405| yajl_tree_free (resi); # 406|-> return NULL; # 407| } # 408| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:438:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 436| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 437| } # 438|-> if (ctx->options & OPT_PARSE_FULLKEY) # 439| ret->_residual = resi; # 440| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_id_mapping' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:438:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 436| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 437| } # 438|-> if (ctx->options & OPT_PARSE_FULLKEY) # 439| ret->_residual = resi; # 440| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:531:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 529| ret->source = strdup (str ? str : ""); # 530| if (ret->source == NULL) # 531|-> return NULL; # 532| } # 533| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:654:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 652| { # 653| yajl_tree_free (resi); # 654|-> return NULL; # 655| } # 656| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_mount' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:689:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs.c:8: included_from: Included from here. # 687| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 688| } # 689|-> if (ctx->options & OPT_PARSE_FULLKEY) # 690| ret->_residual = resi; # 691| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:222:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 220| if (! YAJL_IS_NUMBER (val)) # 221| { # 222|-> *err = strdup ("invalid type"); # 223| return NULL; # 224| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:299:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:8: included_from: Included from here. # 297| } # 298| # 299|-> if (tree->type == yajl_t_object) # 300| { # 301| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:317:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 315| { # 316| yajl_tree_free (resi); # 317|-> return NULL; # 318| } # 319| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall_arg' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:350:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 348| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 349| } # 350|-> if (ctx->options & OPT_PARSE_FULLKEY) # 351| ret->_residual = resi; # 352| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:495:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 493| if (! YAJL_IS_NUMBER (val)) # 494| { # 495|-> *err = strdup ("invalid type"); # 496| return NULL; # 497| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:562:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 560| { # 561| yajl_tree_free (resi); # 562|-> return NULL; # 563| } # 564| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:756:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 754| ret->type = strdup (str ? str : ""); # 755| if (ret->type == NULL) # 756|-> return NULL; # 757| } # 758| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:913:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 911| { # 912| yajl_tree_free (resi); # 913|-> return NULL; # 914| } # 915| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1094:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1092| if (! YAJL_IS_NUMBER (val)) # 1093| { # 1094|-> *err = strdup ("invalid type"); # 1095| return NULL; # 1096| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1149:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1147| { # 1148| yajl_tree_free (resi); # 1149|-> return NULL; # 1150| } # 1151| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_block_io_device' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1180:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 1178| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 1179| } # 1180|-> if (ctx->options & OPT_PARSE_FULLKEY) # 1181| ret->_residual = resi; # 1182| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1261:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1259| if (! YAJL_IS_NUMBER (val)) # 1260| { # 1261|-> *err = strdup ("invalid type"); # 1262| return NULL; # 1263| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1360:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1358| { # 1359| yajl_tree_free (resi); # 1360|-> return NULL; # 1361| } # 1362| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1393:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 1391| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 1392| } # 1393|-> if (ctx->options & OPT_PARSE_FULLKEY) # 1394| ret->_residual = resi; # 1395| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1498:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1496| if (! YAJL_IS_NUMBER (val)) # 1497| { # 1498|-> *err = strdup ("invalid type"); # 1499| return NULL; # 1500| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1575:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1573| { # 1574| yajl_tree_free (resi); # 1575|-> return NULL; # 1576| } # 1577| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1607:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 1605| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 1606| } # 1607|-> if (ctx->options & OPT_PARSE_FULLKEY) # 1608| ret->_residual = resi; # 1609| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1731:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1729| if (! YAJL_IS_NUMBER (val)) # 1730| { # 1731|-> *err = strdup ("invalid type"); # 1732| return NULL; # 1733| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1798:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1796| { # 1797| yajl_tree_free (resi); # 1798|-> return NULL; # 1799| } # 1800| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1982:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1980| if (ret->name == NULL) # 1981| { # 1982|-> if (asprintf (err, "Required field '%s' not present", "name") < 0) # 1983| *err = strdup ("error allocating memory"); # 1984| return NULL; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2005:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 2003| { # 2004| yajl_tree_free (resi); # 2005|-> return NULL; # 2006| } # 2007| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_network_interface_priority' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2036:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 2034| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 2035| } # 2036|-> if (ctx->options & OPT_PARSE_FULLKEY) # 2037| ret->_residual = resi; # 2038| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2119:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 2117| if (! YAJL_IS_NUMBER (val)) # 2118| { # 2119|-> *err = strdup ("invalid type"); # 2120| return NULL; # 2121| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2174:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 2172| { # 2173| yajl_tree_free (resi); # 2174|-> return NULL; # 2175| } # 2176| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_rdma' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2205:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 2203| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 2204| } # 2205|-> if (ctx->options & OPT_PARSE_FULLKEY) # 2206| ret->_residual = resi; # 2207| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2304:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 2302| if (ret->type == NULL) # 2303| { # 2304|-> if (asprintf (err, "Required field '%s' not present", "type") < 0) # 2305| *err = strdup ("error allocating memory"); # 2306| return NULL; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2327:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 2325| { # 2326| yajl_tree_free (resi); # 2327|-> return NULL; # 2328| } # 2329| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_namespace_reference' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2358:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 2356| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 2357| } # 2358|-> if (ctx->options & OPT_PARSE_FULLKEY) # 2359| ret->_residual = resi; # 2360| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2443:24: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 2441| if (! YAJL_IS_NUMBER (val)) # 2442| { # 2443|-> *err = strdup ("invalid type"); # 2444| return NULL; # 2445| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2498:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 2496| { # 2497| yajl_tree_free (resi); # 2498|-> return NULL; # 2499| } # 2500| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_time_offsets' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2529:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 2527| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 2528| } # 2529|-> if (ctx->options & OPT_PARSE_FULLKEY) # 2530| ret->_residual = resi; # 2531| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: scope_hint: In function 'make_runtime_spec_schema_defs_windows_device' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:110:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_windows.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:8: included_from: Included from here. # 108| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 109| } # 110|-> if (ctx->options & OPT_PARSE_FULLKEY) # 111| ret->_residual = resi; # 112| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:110:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 108| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 109| } # 110|-> if (ctx->options & OPT_PARSE_FULLKEY) # 111| ret->_residual = resi; # 112| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:316:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 314| ret->actions = calloc (len + 1, sizeof (*ret->actions)); # 315| if (ret->actions == NULL) # 316|-> return NULL; # 317| for (i = 0; i < len; i++) # 318| { Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c: scope_hint: In function 'make_runtime_spec_schema_features_linux' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:436:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:8: included_from: Included from here. # 434| while (0); # 435| # 436|-> if (tree->type == yajl_t_object) # 437| { # 438| size_t i; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:436:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_seccomp(get_val(tree, "seccomp", 3), ctx, err)' # 434| while (0); # 435| # 436|-> if (tree->type == yajl_t_object) # 437| { # 438| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:454:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 452| { # 453| yajl_tree_free (resi); # 454|-> return NULL; # 455| } # 456| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:777:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 775| resi = calloc (1, sizeof(*tree)); # 776| if (resi == NULL) # 777|-> return NULL; # 778| # 779| resi->type = yajl_t_object; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:784:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 782| { # 783| yajl_tree_free (resi); # 784|-> return NULL; # 785| } # 786| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:907:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 905| resi = calloc (1, sizeof(*tree)); # 906| if (resi == NULL) # 907|-> return NULL; # 908| # 909| resi->type = yajl_t_object; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:914:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 912| { # 913| yajl_tree_free (resi); # 914|-> return NULL; # 915| } # 916| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1037:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1035| resi = calloc (1, sizeof(*tree)); # 1036| if (resi == NULL) # 1037|-> return NULL; # 1038| # 1039| resi->type = yajl_t_object; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1044:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1042| { # 1043| yajl_tree_free (resi); # 1044|-> return NULL; # 1045| } # 1046| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1147:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret' # 1145| ret->namespaces = calloc (len + 1, sizeof (*ret->namespaces)); # 1146| if (ret->namespaces == NULL) # 1147|-> return NULL; # 1148| for (i = 0; i < len; i++) # 1149| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1222:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 1220| { # 1221| yajl_tree_free (resi); # 1222|-> return NULL; # 1223| } # 1224| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'runtime_spec_schema_features_schema_parse_data' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:134:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:9: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:8: included_from: Included from here. # 132| } # 133| # 134|-> if (tree->type == yajl_t_object) # 135| { # 136| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:152:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi' # 150| { # 151| yajl_tree_free (resi); # 152|-> return NULL; # 153| } # 154| resi->u.object.values = calloc (cnt, sizeof (yajl_val)); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:187:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 185| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 186| } # 187|-> if (ctx->options & OPT_PARSE_FULLKEY) # 188| ret->_residual = resi; # 189| } Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'make_runtime_spec_schema_features_schema' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:187:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi' # 185| (void) fprintf (ctx->errfile, "WARNING: unknown key found\n"); # 186| } # 187|-> if (ctx->options & OPT_PARSE_FULLKEY) # 188| ret->_residual = resi; # 189| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-11.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-3.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-6.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-7.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-8.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/tests/test-9.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/yajl/src/yajl_gen.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/libocispec/yajl/src/yajl_lex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/yajl/src/yajl_parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/libocispec/yajl/verify/json_verify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/checkpoint.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/create.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/crun.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/delete.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/exec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/kill.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/blake3/blake3.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/blake3/blake3.c:6: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/blake3/blake3_impl.h: scope_hint: In function 'blake3_compress_subtree_wide' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/blake3/blake3.c:6: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/blake3/blake3_impl.h: scope_hint: In function ‘blake3_compress_subtree_wide’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function 'libcrun_precreate_cgroup_cgroupfs' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function ‘libcrun_precreate_cgroup_cgroupfs’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-resources.c: scope_hint: In function 'update_cgroup_v1_resources' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-resources.c: scope_hint: In function ‘update_cgroup_v1_resources’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-resources.c: scope_hint: In function 'update_cgroup_v2_resources' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-resources.c: scope_hint: In function ‘update_cgroup_v2_resources’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c: scope_hint: In function 'initialize_cpuset_subsystem_rec' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem_rec’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL 'cgroup_crun_exec_path' where non-null expected crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro 'crun_make_error' crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c: scope_hint: In function ‘enter_cgroup_v2’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL ‘cgroup_crun_exec_path’ where non-null expected crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro ‘crun_make_error’ crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/json_common.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'setup_cpuset_for_systemd_v1' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c:269:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cpuset, 589824)' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'setup_cpuset_for_systemd_v1' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘setup_cpuset_for_systemd_v1’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c:269:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_cpuset, 589824)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘setup_cpuset_for_systemd_v1’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘get_cgroup_scope_path’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'libcrun_destroy_cgroup_systemd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘libcrun_destroy_cgroup_systemd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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 ret; # 782| # 783| /* ENOENT can mean both that the file doesn't exist or the controller is not present. */ Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c:963:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cgroup, 720896)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c: scope_hint: In function ‘libcrun_get_cgroup_dirfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c:963:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_cgroup, 720896)’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_destroy' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_destroy’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_update_cgroup_resources' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_update_cgroup_resources’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_preenter' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_preenter’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_enter' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_enter’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/chroot_realpath.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c: scope_hint: In function 'fetchve' crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of 'read_file("/proc/self/cmdline", &cmdline_size)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c: scope_hint: In function ‘fetchve’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of ‘read_file("/proc/self/cmdline", &cmdline_size)’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c: scope_hint: In function 'parse_xargs' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cloned_binary.c: scope_hint: In function ‘parse_xargs’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_load_from_file' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:531:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' # 529| container->config_file_content = xstrdup (config); # 530| # 531|-> return container; # 532| } # 533| Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_load_from_file’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:531:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 529| container->config_file_content = xstrdup (config); # 530| # 531|-> return container; # 532| } # 533| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:655: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' # 653| if (cwd == NULL) # 654| { # 655|-> cwd = cwd_allocated = getcwd (NULL, 0); # 656| if (cwd == NULL) # 657| OOM (); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:931:7: warning[core.NullDereference]: Access to field 'annotations' results in a dereference of a null pointer (loaded from variable 'def') # 929| } # 930| # 931|-> if (def->annotations && def->annotations->len) # 932| { # 933| size_t i; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:1085:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'rootfs' # 1083| ret = sync_socket_wait_sync (NULL, sync_socket, false, err); # 1084| if (UNLIKELY (ret < 0)) # 1085|-> return ret; # 1086| # 1087| has_terminal = container->container_def->process && container->container_def->process->terminal; Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'container_delete_internal' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:1689:15: warning[-Wanalyzer-null-dereference]: dereference of NULL 'container' # 1687| return ret; # 1688| # 1689|-> def = container->container_def; # 1690| } # 1691| Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘container_delete_internal’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:1689:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘container’ # 1687| return ret; # 1688| # 1689|-> def = container->container_def; # 1690| } # 1691| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:1843:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'intelrdt' # 1841| # 1842| if (external_descriptors == NULL) # 1843|-> return crun_make_error (err, 0, "invalid internal state. No external descriptors found"); # 1844| return libcrun_write_container_status (context->state_root, context->id, &status, err); # 1845| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:2839:3: warning[deadcode.DeadStores]: Value stored to 'exec_fifo_fd' is never read # 2837| # 2838| context->fifo_exec_wait_fd = exec_fifo_fd; # 2839|-> exec_fifo_fd = -1; # 2840| # 2841| if ((options & LIBCRUN_RUN_OPTIONS_PREFORK) == 0) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3083:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 3081| goto exit; # 3082| # 3083|-> ret = 0; # 3084| gen = yajl_gen_alloc (NULL); # 3085| if (gen == NULL) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3330:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'seccomp_fd_payload' # 3328| ret = get_seccomp_receiver_fd_payload (container, "running", own_pid, &seccomp_fd_payload, &seccomp_fd_payload_len, err); # 3329| if (UNLIKELY (ret < 0)) # 3330|-> return ret; # 3331| } # 3332| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3383:20: warning[unix.Malloc]: Potential leak of memory pointed to by 'seccomp_fd_payload' # 3381| ret = get_seccomp_receiver_fd_payload (container, "running", own_pid, &seccomp_fd_payload, &seccomp_fd_payload_len, err); # 3382| if (UNLIKELY (ret < 0)) # 3383|-> return ret; # 3384| } # 3385| ret = libcrun_apply_seccomp (seccomp_fd, seccomp_receiver_fd, seccomp_fd_payload, Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'exec_process_entrypoint' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3398:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1' # 3396| # 3397| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1)); # 3398|-> TEMP_FAILURE_RETRY (close (pipefd1)); # 3399| pipefd1 = -1; # 3400| Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘exec_process_entrypoint’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3398:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’ # 3396| # 3397| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1)); # 3398|-> TEMP_FAILURE_RETRY (close (pipefd1)); # 3399| pipefd1 = -1; # 3400| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3399:3: warning[deadcode.DeadStores]: Value stored to 'pipefd1' is never read # 3397| TEMP_FAILURE_RETRY (write (pipefd1, "0", 1)); # 3398| TEMP_FAILURE_RETRY (close (pipefd1)); # 3399|-> pipefd1 = -1; # 3400| # 3401| if (custom_handler) Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3567:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'process' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' # 3565| # 3566| /* This must be done before we enter a user namespace. */ # 3567|-> ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err); # 3568| if (UNLIKELY (ret < 0)) # 3569| return ret; Error: GCC_ANALYZER_WARNING (CWE-476): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3567:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘process’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ # 3565| # 3566| /* This must be done before we enter a user namespace. */ # 3567|-> ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err); # 3568| if (UNLIKELY (ret < 0)) # 3569| return ret; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3582:32: warning[-Wanalyzer-malloc-leak]: leak of '*process.selinux_label' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' # 3580| { # 3581| if (process->selinux_label == NULL && container->container_def->process->selinux_label) # 3582|-> process->selinux_label = xstrdup (container->container_def->process->selinux_label); # 3583| # 3584| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile) Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3582:32: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.selinux_label’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ # 3580| { # 3581| if (process->selinux_label == NULL && container->container_def->process->selinux_label) # 3582|-> process->selinux_label = xstrdup (container->container_def->process->selinux_label); # 3583| # 3584| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile) Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3585:35: warning[-Wanalyzer-malloc-leak]: leak of '*process.apparmor_profile' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' # 3583| # 3584| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile) # 3585|-> process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile); # 3586| } # 3587| Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3585:35: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.apparmor_profile’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ # 3583| # 3584| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile) # 3585|-> process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile); # 3586| } # 3587| Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3604:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd0' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' # 3602| if (pid == 0) # 3603| { # 3604|-> TEMP_FAILURE_RETRY (close (pipefd0)); # 3605| pipefd0 = -1; # 3606| Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3604:27: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ # 3602| if (pid == 0) # 3603| { # 3604|-> TEMP_FAILURE_RETRY (close (pipefd0)); # 3605| pipefd0 = -1; # 3606| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3605:7: warning[deadcode.DeadStores]: Value stored to 'pipefd0' is never read # 3603| { # 3604| TEMP_FAILURE_RETRY (close (pipefd0)); # 3605|-> pipefd0 = -1; # 3606| # 3607| exec_process_entrypoint (context, container, process, pipefd1, seccomp_fd, seccomp_receiver_fd, custom_handler, err); Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3615:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' # 3613| } # 3614| # 3615|-> TEMP_FAILURE_RETRY (close (pipefd1)); # 3616| pipefd1 = -1; # 3617| Error: GCC_ANALYZER_WARNING (CWE-1341): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3615:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ # 3613| } # 3614| # 3615|-> TEMP_FAILURE_RETRY (close (pipefd1)); # 3616| pipefd1 = -1; # 3617| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3616:3: warning[deadcode.DeadStores]: Value stored to 'pipefd1' is never read # 3614| # 3615| TEMP_FAILURE_RETRY (close (pipefd1)); # 3616|-> pipefd1 = -1; # 3617| # 3618| TEMP_FAILURE_RETRY (write (pipefd0, &pid, sizeof (pid))); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:3661:3: warning[deadcode.DeadStores]: Value stored to 'pipefd0' is never read # 3659| ret = TEMP_FAILURE_RETRY (read (pipefd0, &b, sizeof (b))); # 3660| TEMP_FAILURE_RETRY (close (pipefd0)); # 3661|-> pipefd0 = -1; # 3662| if (ret != 1 || b != '0') # 3663| ret = -1; Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function 'restore_cgroup_v1_mount' crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:294:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function ‘restore_cgroup_v1_mount’ crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:294:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:296:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:296:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function 'checkpoint_cgroup_v1_mount' crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:361:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function ‘checkpoint_cgroup_v1_mount’ crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:361:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:363:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:363:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_checkpoint_linux_criu' crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:438:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_checkpoint_linux_criu’ crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:438:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:458:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:458:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function 'prepare_restore_mounts' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function ‘prepare_restore_mounts’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_restore_linux_criu' crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:761:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_restore_linux_criu’ crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:761:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:817:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:817:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:906:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_134.path, 0)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:906:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_134.path, 0)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:915:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_151.path, 0)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/criu.c:915:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_151.path, 0)’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/custom-handler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/ebpf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-835): crun-1.14.4-build/crun-1.14.4/src/libcrun/ebpf.c: scope_hint: In function ‘read_all_progs’ crun-1.14.4-build/crun-1.14.4/src/libcrun/ebpf.c:294:18: warning[-Wanalyzer-infinite-loop]: infinite loop crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/error.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/handler-utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container' crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: 'create_sev' may be used uninitialized # 248 | if (create_sev) # | ^ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’ crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: ‘create_sev’ may be used uninitialized # 248 | if (create_sev) # | ^ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_load' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_load’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/mono.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/spin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/wasmedge.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/wasmer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/handlers/wasmtime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/intelrdt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/intelrdt.c: scope_hint: In function 'resctl_update' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/intelrdt.c: scope_hint: In function ‘resctl_update’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/io_priority.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:1697:21: warning[unix.Malloc]: Potential leak of memory pointed to by 'dirname' # 1695| # 1696| if (dirname[0] == '\0') # 1697|-> dirfd = dup (rootfsfd); # 1698| else # 1699| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:1787:51: warning[core.NullDereference]: Array access (via field 'fds') results in a null pointer dereference # 1785| if (! def->linux->devices[i]->file_mode_present) # 1786| device.mode = 0666; # 1787|-> ret = libcrun_create_dev (container, devfd, dev_fds->fds[i], &device, binds, true, err); # 1788| if (UNLIKELY (ret < 0)) # 1789| return ret; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2022:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer' # 2020| part, 0755, err); # 2021| if (UNLIKELY (parent_dir_fd < 0)) # 2022|-> return crun_make_error (err, errno, "symlink creation"); # 2023| # 2024| /* It is safe to reuse the buffer since it was created with xstrdup (destination). */ Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2100:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'data' # 2098| # 2099| if (type == NULL && (flags & MS_BIND) == 0) # 2100|-> return crun_make_error (err, 0, "invalid mount type for `%s`", def->mounts[i]->destination); # 2101| # 2102| if (flags & MS_BIND) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2343:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'data' # 2341| is_dir ? 01755 : 0755, err); # 2342| if (UNLIKELY (ret < 0)) # 2343|-> return ret; # 2344| # 2345| targetfd = ret; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2507:36: warning[unix.Malloc]: Potential leak of memory pointed to by 'container_notify_socket_path_dir_alloc' # 2505| # 2506| container_notify_socket_path_dir_alloc = xstrdup (container_notify_socket_path); # 2507|-> container_notify_socket_path_dir = dirname (container_notify_socket_path_dir_alloc); # 2508| # 2509| ret = crun_ensure_directory (container_notify_socket_path_dir, 0755, false, err); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2555:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'tmp' # 2553| ret = mount (NULL, tmp, NULL, MS_PRIVATE, NULL); # 2554| if (ret == 0) # 2555|-> return 0; # 2556| # 2557| if (errno == EINVAL) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:2621: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' # 2619| else # 2620| { # 2621|-> rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC); # 2622| if (UNLIKELY (rootfsfd < 0)) # 2623| return crun_make_error (err, errno, "open `%s`", rootfs); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3040:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'gid_map' # 3038| # 3039| xasprintf (&gid_map_file, "/proc/%d/gid_map", pid); # 3040|-> ret = write_file (gid_map_file, gid_map, gid_map_len, err); # 3041| 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))) # 3042| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3071:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'uid_map' # 3069| # 3070| xasprintf (&uid_map_file, "/proc/%d/uid_map", pid); # 3071|-> ret = write_file (uid_map_file, uid_map, uid_map_len, err); # 3072| 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))) # 3073| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3087:15: warning[unix.Malloc]: Potential leak of memory pointed to by 'single_mapping' # 3085| single_mapping = format_mount_mapping (container->container_uid, container->host_uid, 1, &single_mapping_len); # 3086| # 3087|-> ret = write_file (uid_map_file, single_mapping, single_mapping_len, err); # 3088| } # 3089| } Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3383:15: warning[deadcode.DeadStores]: Value stored to 'namespace' during its initialization is never read # 3381| 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) # 3382| { # 3383|-> const char *namespace = ""; # 3384| # 3385| name = consume_slashes (name); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3485:16: warning[unix.Malloc]: Potential leak of memory pointed to by 'it' # 3483| ret = validate_sysctl (def->linux->sysctl->keys[i], def->linux->sysctl->values[i], name, namespaces_created, def, err); # 3484| if (UNLIKELY (ret < 0)) # 3485|-> return ret; # 3486| # 3487| fd = openat (dirfd, name, O_WRONLY | O_CLOEXEC); Error: CPPCHECK_WARNING (CWE-457): crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:3648: error[uninitvar]: Uninitialized variable: code # 3646| if (UNLIKELY (ret < 0)) # 3647| return false; # 3648|-> *error = code; # 3649| } # 3650| Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:4858:11: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 4856| # 4857| /* Cleanup the first process. */ # 4858|-> ret = waitpid_ignore_stopped (pid, NULL, 0); # 4859| # 4860| pid_to_clean = pid = new_pid; Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:5743:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'buffer' # 5741| ret = syscall_getcwd (buffer, PATH_MAX); # 5742| if (UNLIKELY (ret < 0)) # 5743|-> return crun_make_error (err, errno, "getcwd"); # 5744| # 5745| /* Enforce that the returned path is an absolute path. */ Error: COMPILER_WARNING (CWE-252): crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c: scope_hint: In function 'libcrun_safe_chdir' crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:5748:14: warning[-Wunused-result]: ignoring return value of 'chdir' declared with attribute 'warn_unused_result' # 5748 | (void) chdir ("/"); # | ^~~~~~~~~~~ # 5746| if (ret == 0 || buffer[0] != '/') # 5747| { # 5748|-> (void) chdir ("/"); # 5749| errno = ENOENT; # 5750| Error: COMPILER_WARNING (CWE-252): crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c: scope_hint: In function ‘libcrun_safe_chdir’ crun-1.14.4-build/crun-1.14.4/src/libcrun/linux.c:5748:14: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’ # 5748 | (void) chdir ("/"); # | ^~~~~~~~~~~ # 5746| if (ret == 0 || buffer[0] != '/') # 5747| { # 5748|-> (void) chdir ("/"); # 5749| errno = ENOENT; # 5750| Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/mount_flags.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/scheduler.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'open_rundir_dirfd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘open_rundir_dirfd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL 'entries' where non-null expected crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL ‘entries’ where non-null expected crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp_notify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/signals.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:49:12: warning[-Wanalyzer-malloc-leak]: leak of 'get_run_directory(state_root)' # 47| if (state_root) # 48| root = xstrdup (state_root); # 49|-> if (root == NULL) # 50| { # 51| const char *runtime_dir = getenv ("XDG_RUNTIME_DIR"); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:49:12: warning[-Wanalyzer-malloc-leak]: leak of ‘get_run_directory(state_root)’ # 47| if (state_root) # 48| root = xstrdup (state_root); # 49|-> if (root == NULL) # 50| { # 51| const char *runtime_dir = getenv ("XDG_RUNTIME_DIR"); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'read_pid_stat' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:118:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&pid_stat_file, 524288)' # 116| sprintf (pid_stat_file, "/proc/%d/stat", pid); # 117| # 118|-> fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC); # 119| if (fd < 0) # 120| { Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘read_pid_stat’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:118:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&pid_stat_file, 524288)’ # 116| sprintf (pid_stat_file, "/proc/%d/stat", pid); # 117| # 118|-> fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC); # 119| if (fd < 0) # 120| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:443:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'run_directory' # 441| int ret; # 442| # 443|-> ret = crun_ensure_directory (run_directory, 0700, false, err); # 444| if (UNLIKELY (ret < 0)) # 445| return ret; Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'rmdirfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:472:7: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(fd)' # 470| __attribute__ ((unused)) cleanup_close int fd_cleanup = fd; # 471| # 472|-> d = fdopendir (fd); # 473| if (d == NULL) # 474| return crun_make_error (err, errno, "cannot open directory `%s`", namedir); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘rmdirfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:472:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(fd)’ # 470| __attribute__ ((unused)) cleanup_close int fd_cleanup = fd; # 471| # 472|-> d = fdopendir (fd); # 473| if (d == NULL) # 474| return crun_make_error (err, errno, "cannot open directory `%s`", namedir); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:501:15: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 499| return ret; # 500| # 501|-> ret = unlinkat (dirfd (d), de->d_name, AT_REMOVEDIR); # 502| } # 503| } Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:521:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(get_run_directory(state_root), 589824)' # 519| return crun_make_error (err, 0, "cannot get state directory"); # 520| # 521|-> rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_RDONLY | O_CLOEXEC)); # 522| if (UNLIKELY (rundir_dfd < 0)) # 523| return crun_make_error (err, errno, "cannot open run directory `%s`", dir); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:521:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(get_run_directory(state_root), 589824)’ # 519| return crun_make_error (err, 0, "cannot get state directory"); # 520| # 521|-> rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_RDONLY | O_CLOEXEC)); # 522| if (UNLIKELY (rundir_dfd < 0)) # 523| return crun_make_error (err, errno, "cannot open run directory `%s`", dir); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:532:3: warning[deadcode.DeadStores]: Value stored to 'dfd' is never read # 530| # 531| /* rmdirfd owns DFD. */ # 532|-> dfd = -1; # 533| # 534| if (UNLIKELY (ret < 0)) Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:535:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'dir' # 533| # 534| if (UNLIKELY (ret < 0)) # 535|-> return ret; # 536| # 537| ret = unlinkat (rundir_dfd, id, AT_REMOVEDIR); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:542:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'rundir_dfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/error.h:42: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:22: included_from: Included from here. # 540| # 541| return 0; # 542|-> } # 543| # 544| void Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:542:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rundir_dfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/error.h:42: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:22: included_from: Included from here. # 540| # 541| return 0; # 542|-> } # 543| # 544| void Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:568:9: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(get_run_directory(state_root))' # 566| # 567| *ret = NULL; # 568|-> dir = opendir (path); # 569| if (UNLIKELY (dir == NULL)) # 570| return crun_make_error (err, errno, "cannot opendir `%s`", path); Error: GCC_ANALYZER_WARNING (CWE-401): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:568:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(get_run_directory(state_root))’ # 566| # 567| *ret = NULL; # 568|-> dir = opendir (path); # 569| if (UNLIKELY (dir == NULL)) # 570| return crun_make_error (err, errno, "cannot opendir `%s`", path); Error: GCC_ANALYZER_WARNING (CWE-688): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_get_containers_list’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:568:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected crun-1.14.4-build/crun-1.14.4/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 # 566| # 567| *ret = NULL; # 568|-> dir = opendir (path); # 569| if (UNLIKELY (dir == NULL)) # 570| return crun_make_error (err, errno, "cannot opendir `%s`", path); Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:603:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'path' # 601| tmp = next_container; # 602| } # 603|-> *ret = tmp; # 604| tmp = NULL; # 605| return 0; Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'libcrun_status_create_exec_fifo' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:677:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 526336)' # 675| return crun_make_error (err, errno, "mkfifo"); # 676| # 677|-> fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC); # 678| if (UNLIKELY (fd < 0)) # 679| return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_create_exec_fifo’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:677:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 526336)’ # 675| return crun_make_error (err, errno, "mkfifo"); # 676| # 677|-> fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC); # 678| if (UNLIKELY (fd < 0)) # 679| return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'libcrun_status_write_exec_fifo' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:699:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 524289)' # 697| return ret; # 698| # 699|-> fd = open (fifo_path, O_WRONLY | O_CLOEXEC); # 700| if (UNLIKELY (fd < 0)) # 701| return crun_make_error (err, errno, "cannot open `%s`", fifo_path); Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_write_exec_fifo’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c:699:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 524289)’ # 697| return ret; # 698| # 699|-> fd = open (fifo_path, O_WRONLY | O_CLOEXEC); # 700| if (UNLIKELY (fd < 0)) # 701| return crun_make_error (err, errno, "cannot open `%s`", fifo_path); Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/libcrun/terminal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'read_file_as_long_or_default' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘read_file_as_long_or_default’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/intelrdt.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'resctl_update' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'intelrdt_clean_l3_cache_schema(l3_cache_schema)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'safe_read_xattr' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(current_size + 1))' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'copy_xattr' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(xattr_len + 1))' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp_notify.c:32: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_load_seccomp_notify_plugins' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((n_parts_a + 1) * 8)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(16)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(256)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'read_all_fd_with_size_hint' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(allocated + 1)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'read_all_fd_with_size_hint' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'write_controller_file' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(controllers_len + 1)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'copy_from_fd_to_fd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(get_page_size())' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c:25: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_copy_seccomp' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(in_size + 1)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(name_len + 2)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/intelrdt.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘resctl_update’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘intelrdt_clean_l3_cache_schema(l3_cache_schema)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘safe_read_xattr’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(current_size + 1))’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘copy_xattr’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(xattr_len + 1))’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp_notify.c:32: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_load_seccomp_notify_plugins’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((n_parts_a + 1) * 8)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘test_write_read_file’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(1024)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(16)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘append_systemd_annotation’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(256)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/exec.c:29: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(88)’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:29: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘read_all_fd_with_size_hint’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(allocated + 1)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘read_all_fd_with_size_hint’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-utils.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘write_controller_file’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(controllers_len + 1)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘copy_from_fd_to_fd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(get_page_size())’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c:25: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_copy_seccomp’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(in_size + 1)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(name_len + 2)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file("config.json", err)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update_intel_rdt' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file(config_file, err)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_load_from_file' crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0((num_mount_options + 1) * 8)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(120)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(136)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(176)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_cgroup_enter' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(24)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(48)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file("config.json", err)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update_intel_rdt’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file(config_file, err)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_load_from_file’ crun-1.14.4-build/crun-1.14.4/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.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘make_oci_process_user(exec_options.user)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)(argc + 1) * 8)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((num_mount_options + 1) * 8)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(120)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(136)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(176)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.c:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_cgroup_enter’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(24)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(48)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘make_oci_process_user’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(56)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(buffer, (long unsigned int)(current_size + 1))' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'evict_cache' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 88)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_ebpf_load' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(log, log_size)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/ebpf.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'read_all_progs' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(progs, cur_size * 4)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'safe_readlinkat' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(buffer, (long unsigned int)(current_size + 1))’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘evict_cache’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(entries, (n_entries + 1) * 88)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_ebpf_load’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(log, log_size)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/ebpf.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘read_all_progs’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(progs, cur_size * 4)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘safe_readlinkat’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'buffer' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'entries' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'log' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'progs' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'tmp_buf' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buffer’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘entries’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘log’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘progs’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘tmp_buf’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:104:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'fd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:104:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:104:7: warning[-Wmaybe-uninitialized]: 'fd' may be used uninitialized # 104 | if (*pp >= 0) # | ^~~ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'read_all_file_at' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:104:7: warning[-Wmaybe-uninitialized]: ‘fd’ may be used uninitialized # 104 | if (*pp >= 0) # | ^~~ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘read_all_file_at’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/error.h:42: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/container.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.h:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cgroup_dirfd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'console_socket_fd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destdirfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_cpuset' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_htlb' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netclass' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netprio' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd_cleanup' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'image_fd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY' crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'root_fd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rootfsfd_cleanup' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'signalfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcfd' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'wfd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/error.h:42: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/container.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup.h:21: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘<unknown>’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘cfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/status.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘cgroup_dirfd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘console_socket_fd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destdirfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destfd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_cpuset’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-systemd.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_htlb’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_netclass’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd_netprio’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd1’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd_cleanup’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘image_fd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/seccomp.h:24: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘outfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_utils.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘root_fd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘rootfsfd_cleanup’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘signalfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘srcfd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘wfd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_set_stdio' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_set_stdio’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'close_and_reset' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'own_seccomp_receiver_fd' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'close_and_reset' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_fd' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'close_and_reset' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'close_and_reset' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'terminal_fd' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'close_and_reset' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘own_seccomp_receiver_fd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘seccomp_fd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘terminal_fd’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_new_terminal' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_70->process.selinux_label)' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_75->process.apparmor_profile)' crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore_linux_criu' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*status.bundle)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(executable_path)' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function 'find_executable' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'read_unified_cgroup_pid' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(from)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'find_executable' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper' crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(name)' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'maybe_make_cgroup_threaded' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function 'append_systemd_annotation' crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_new_terminal’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_70->process.selinux_label)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_75->process.apparmor_profile)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore_linux_criu’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*status.bundle)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(executable_path)’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.c: scope_hint: In function ‘find_executable’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-internal.h:22: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/cgroup-setup.c:23: included_from: Included from here. crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘read_unified_cgroup_pid’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(from)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘find_executable’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’ crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(name)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘maybe_make_cgroup_threaded’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/src/libcrun/utils.h: scope_hint: In function ‘append_systemd_annotation’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/list.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/oci_features.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/pause.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/ps.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/restore.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/run.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/run.c:148: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' # 146| /* Make sure the bundle is an absolute path. */ # 147| if (bundle == NULL) # 148|-> bundle = bundle_cleanup = getcwd (NULL, 0); # 149| else # 150| { Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/src/run.c:174:33: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 172| if (getenv ("LISTEN_FDS")) # 173| { # 174|-> crun_context.listen_fds = strtoll (getenv ("LISTEN_FDS"), NULL, 10); # 175| crun_context.preserve_fds += crun_context.listen_fds; # 176| } Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/spec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/src/spec.c: scope_hint: In function ‘crun_command_spec’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/src/start.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/state.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/unpause.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/src/update.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): crun-1.14.4-build/crun-1.14.4/tests/init.c: scope_hint: In function ‘write_to’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/init.c: scope_hint: In function ‘check_idmapped_mounts’ crun-1.14.4-build/crun-1.14.4/tests/init.c:209:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&proc_path, 0)’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/init.c: scope_hint: In function ‘cat’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/tests/init.c: scope_hint: In function ‘main’ crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/init.c: scope_hint: In function ‘main’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_errors.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘test_generate_ebpf’ crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_fuzzer.c:105:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘generate_seccomp’ crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_intelrdt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: crun-1.14.4-build/crun-1.14.4/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: crun-1.14.4-build/crun-1.14.4/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): crun-1.14.4-build/crun-1.14.4/tests/tests_libcrun_utils.c: scope_hint: In function ‘test_send_receive_fd’ crun-1.14.4-build/crun-1.14.4/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