crun-1.18.2-1.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
crun-1.18.2-build/crun-1.18.2/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): [#def2]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:50:16: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:48:25: note: in expansion of macro 'YAJL_GET_STRING'
#   48|               char *str = YAJL_GET_STRING (val);
#   49|               ret->second = strdup (str ? str : "");
#   50|->             if (ret->second == NULL)
#   51|                 return NULL;
#   52|             }

Error: CPPCHECK_WARNING (CWE-401): [#def3]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:122: error[memleak]: Memory leak: ret
#  120|           ret->second = strdup (src->second);
#  121|           if (ret->second == NULL)
#  122|->           return NULL;
#  123|         }
#  124|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:328:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  326|       while (0);
#  327|   
#  328|->     if (tree->type == yajl_t_object)
#  329|         {
#  330|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:328:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
#  326|       while (0);
#  327|   
#  328|->     if (tree->type == yajl_t_object)
#  329|         {
#  330|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:395:53: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.strarrays_item_lens + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'free_basic_test_double_array'
#  393|             {
#  394|               size_t j;
#  395|->             for (j = 0; j < ptr->strarrays_item_lens[i]; j++)
#  396|                 {
#  397|                   free (ptr->strarrays[i][j]);

Error: CPPCHECK_WARNING (CWE-401): [#def7]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:675: error[memleak]: Memory leak: ret
#  673|           ret->strarrays = calloc (src->strarrays_len + 1, sizeof (*ret->strarrays));
#  674|           if (ret->strarrays == NULL)
#  675|->           return NULL;
#  676|           for (size_t i = 0; i < src->strarrays_len; i++)
#  677|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_data'
crun-1.18.2-build/crun-1.18.2/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: CPPCHECK_WARNING (CWE-401): [#def9]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:214: error[memleak]: Memory leak: ret
#  212|           ret->item1 = strdup (src->item1);
#  213|           if (ret->item1 == NULL)
#  214|->           return NULL;
#  215|         }
#  216|       ret->item2 = src->item2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def11]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:31: error[memleak]: Memory leak: ptr
#   29|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#   30|       if (ptr->items == NULL)
#   31|->       return NULL;
#   32|       ptr->len = alen;
#   33|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:35:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#   33|   
#   34|   
#   35|->     for (i = 0; i < alen; i++)
#   36|         {
#   37|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:151:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:151:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
#  149|   }
#  150|   
#  151|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  152|   
#  153|    basic_test_top_array_int_container * basic_test_top_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:159:18: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c:151:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_int.c: scope_hint: In function 'basic_test_top_array_int_container_parse_file_stream'
#  157|       struct parser_context tmp_ctx = { 0 };
#  158|   
#  159|->     if (jsondata == NULL || err == NULL)
#  160|         return NULL;
#  161|   

Error: CPPCHECK_WARNING (CWE-401): [#def15]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_string.c:31: error[memleak]: Memory leak: ptr
#   29|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#   30|       if (ptr->items == NULL)
#   31|->       return NULL;
#   32|       ptr->len = alen;
#   33|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_string.c:152:18: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_string.c:144:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_array_string.c: scope_hint: In function 'basic_test_top_array_string_container_parse_file_stream'
#  150|       struct parser_context tmp_ctx = { 0 };
#  151|   
#  152|->     if (jsondata == NULL || err == NULL)
#  153|         return NULL;
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def18]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:31: error[memleak]: Memory leak: ptr
#   29|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#   30|       if (ptr->items == NULL)
#   31|->       return NULL;
#   32|       ptr->len = alen;
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));

Error: CPPCHECK_WARNING (CWE-401): [#def19]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:35: error[memleak]: Memory leak: ptr
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
#   34|       if (ptr->subitem_lens == NULL)
#   35|->       return NULL;
#   36|   
#   37|       for (i = 0; i < alen; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:37:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#   35|         return NULL;
#   36|   
#   37|->     for (i = 0; i < alen; i++)
#   38|         {
#   39|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
#  172|   }
#  173|   
#  174|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  175|   
#  176|    basic_test_top_double_array_int_container * basic_test_top_double_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:182:18: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_int.c: scope_hint: In function 'basic_test_top_double_array_int_container_parse_file_stream'
#  180|       struct parser_context tmp_ctx = { 0 };
#  181|   
#  182|->     if (jsondata == NULL || err == NULL)
#  183|         return NULL;
#  184|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
crun-1.18.2-build/crun-1.18.2/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): [#def24]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:158: error[memleak]: Memory leak: ret
#  156|           ret->third = strdup (src->third);
#  157|           if (ret->third == NULL)
#  158|->           return NULL;
#  159|         }
#  160|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def25]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:182: error[memleak]: Memory leak: ptr
#  180|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#  181|       if (ptr->items == NULL)
#  182|->       return NULL;
#  183|       ptr->len = alen;
#  184|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));

Error: CPPCHECK_WARNING (CWE-401): [#def26]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:186: error[memleak]: Memory leak: ptr
#  184|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
#  185|       if (ptr->subitem_lens == NULL)
#  186|->       return NULL;
#  187|   
#  188|       for (i = 0; i < alen; i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:220:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0'
#  218|         {
#  219|             size_t j;
#  220|->           for (j = 0; j < ptr->subitem_lens[i]; j++)
#  221|               {
#  222|                 free_basic_test_top_double_array_obj_element (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:222:15: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'free_basic_test_top_double_array_obj_container.part.0'
#  220|             for (j = 0; j < ptr->subitem_lens[i]; j++)
#  221|               {
#  222|->               free_basic_test_top_double_array_obj_element (ptr->items[i][j]);
#  223|                 ptr->items[i][j] = NULL;
#  224|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_refobj_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'basic_test_top_double_array_refobj_container_parse_file_stream'
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:15: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_refobj_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def31]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:31: error[memleak]: Memory leak: ptr
#   29|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#   30|       if (ptr->items == NULL)
#   31|->       return NULL;
#   32|       ptr->len = alen;
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));

Error: CPPCHECK_WARNING (CWE-401): [#def32]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:35: error[memleak]: Memory leak: ptr
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
#   34|       if (ptr->subitem_lens == NULL)
#   35|->       return NULL;
#   36|   
#   37|       for (i = 0; i < alen; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:37:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#   35|         return NULL;
#   36|   
#   37|->     for (i = 0; i < alen; i++)
#   38|         {
#   39|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:69:44: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0'
#   67|         {
#   68|             size_t j;
#   69|->           for (j = 0; j < ptr->subitem_lens[i]; j++)
#   70|               {
#   71|                 free_basic_test_double_array_item (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:36: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
#  164|   }
#  165|   
#  166|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  167|   
#  168|    basic_test_top_double_array_refobj_container * basic_test_top_double_array_refobj_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

Error: CPPCHECK_WARNING (CWE-401): [#def36]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:31: error[memleak]: Memory leak: ptr
#   29|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#   30|       if (ptr->items == NULL)
#   31|->       return NULL;
#   32|       ptr->len = alen;
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));

Error: CPPCHECK_WARNING (CWE-401): [#def37]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:35: error[memleak]: Memory leak: ptr
#   33|       ptr->subitem_lens = calloc ( alen + 1, sizeof (size_t));
#   34|       if (ptr->subitem_lens == NULL)
#   35|->       return NULL;
#   36|   
#   37|       for (i = 0; i < alen; i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:74:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
#   72|         {
#   73|           size_t j;
#   74|->         for (j = 0; j < ptr->subitem_lens[i]; j++)
#   75|             {
#   76|               free (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:76:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
#   74|           for (j = 0; j < ptr->subitem_lens[i]; j++)
#   75|             {
#   76|->             free (ptr->items[i][j]);
#   77|               ptr->items[i][j] = NULL;
#   78|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:179:18: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c:171:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'basic_test_top_double_array_string_container_parse_file_stream'
#  177|       struct parser_context tmp_ctx = { 0 };
#  178|   
#  179|->     if (jsondata == NULL || err == NULL)
#  180|         return NULL;
#  181|   

Error: CPPCHECK_WARNING (CWE-401): [#def41]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:256: error[memleak]: Memory leak: ret
#  254|           ret->config = strdup (src->config);
#  255|           if (ret->config == NULL)
#  256|->           return NULL;
#  257|         }
#  258|       if (src->layers)

Error: CPPCHECK_WARNING (CWE-401): [#def42]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:263: error[memleak]: Memory leak: ret
#  261|           ret->layers = calloc (src->layers_len + 1, sizeof (*ret->layers));
#  262|           if (ret->layers == NULL)
#  263|->           return NULL;
#  264|           for (size_t i = 0; i < src->layers_len; i++)
#  265|             {

Error: CPPCHECK_WARNING (CWE-401): [#def43]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:318: error[memleak]: Memory leak: ptr
#  316|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#  317|       if (ptr->items == NULL)
#  318|->       return NULL;
#  319|       ptr->len = alen;
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:182:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: note: in expansion of macro 'YAJL_IS_TRUE'
#  180|       while (0);
#  181|   
#  182|->     if (tree->type == yajl_t_object)
#  183|         {
#  184|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def45]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:491: error[memleak]: Memory leak: ret
#  489|           ret->user = strdup (src->user);
#  490|           if (ret->user == NULL)
#  491|->           return NULL;
#  492|         }
#  493|       if (src->exposed_ports)

Error: CPPCHECK_WARNING (CWE-401): [#def46]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:497: error[memleak]: Memory leak: ret
#  495|           ret->exposed_ports = calloc (1, sizeof (image_spec_schema_defs_map_string_object));
#  496|           if (ret->exposed_ports == NULL)
#  497|->             return NULL;
#  498|           ret->exposed_ports->len = src->exposed_ports->len;
#  499|           ret->exposed_ports->keys = calloc (src->exposed_ports->len + 1, sizeof (char *));

Error: CPPCHECK_WARNING (CWE-401): [#def47]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:501: error[memleak]: Memory leak: ret
#  499|           ret->exposed_ports->keys = calloc (src->exposed_ports->len + 1, sizeof (char *));
#  500|           if (ret->exposed_ports->keys == NULL)
#  501|->             return NULL;
#  502|           ret->exposed_ports->values = calloc (src->exposed_ports->len + 1, sizeof (*ret->exposed_ports->values));
#  503|           if (ret->exposed_ports->values == NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def48]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:504: error[memleak]: Memory leak: ret
#  502|           ret->exposed_ports->values = calloc (src->exposed_ports->len + 1, sizeof (*ret->exposed_ports->values));
#  503|           if (ret->exposed_ports->values == NULL)
#  504|->             return NULL;
#  505|           for (size_t i = 0; i < ret->exposed_ports->len; i++)
#  506|             {

Error: CPPCHECK_WARNING (CWE-401): [#def49]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:818: error[memleak]: Memory leak: ret
#  816|           ret->diff_ids = calloc (src->diff_ids_len + 1, sizeof (*ret->diff_ids));
#  817|           if (ret->diff_ids == NULL)
#  818|->           return NULL;
#  819|           for (size_t i = 0; i < src->diff_ids_len; i++)
#  820|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:904:38: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:855:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: note: in expansion of macro 'YAJL_IS_TRUE'
#  902|             {
#  903|               ret->empty_layer = YAJL_IS_TRUE(val);
#  904|->             ret->empty_layer_present = 1;
#  905|             }
#  906|           else

Error: CPPCHECK_WARNING (CWE-401): [#def51]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1024: error[memleak]: Memory leak: ret
# 1022|           ret->created = strdup (src->created);
# 1023|           if (ret->created == NULL)
# 1024|->           return NULL;
# 1025|         }
# 1026|       if (src->author)

Error: CPPCHECK_WARNING (CWE-401): [#def52]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1030: error[memleak]: Memory leak: ret
# 1028|           ret->author = strdup (src->author);
# 1029|           if (ret->author == NULL)
# 1030|->           return NULL;
# 1031|         }
# 1032|       if (src->created_by)

Error: CPPCHECK_WARNING (CWE-401): [#def53]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1036: error[memleak]: Memory leak: ret
# 1034|           ret->created_by = strdup (src->created_by);
# 1035|           if (ret->created_by == NULL)
# 1036|->           return NULL;
# 1037|         }
# 1038|       if (src->comment)

Error: CPPCHECK_WARNING (CWE-401): [#def54]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1042: error[memleak]: Memory leak: ret
# 1040|           ret->comment = strdup (src->comment);
# 1041|           if (ret->comment == NULL)
# 1042|->           return NULL;
# 1043|         }
# 1044|       ret->empty_layer = src->empty_layer;

Error: CPPCHECK_WARNING (CWE-401): [#def55]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1499: error[memleak]: Memory leak: ret
# 1497|           ret->created = strdup (src->created);
# 1498|           if (ret->created == NULL)
# 1499|->           return NULL;
# 1500|         }
# 1501|       if (src->author)

Error: CPPCHECK_WARNING (CWE-401): [#def56]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1505: error[memleak]: Memory leak: ret
# 1503|           ret->author = strdup (src->author);
# 1504|           if (ret->author == NULL)
# 1505|->           return NULL;
# 1506|         }
# 1507|       if (src->architecture)

Error: CPPCHECK_WARNING (CWE-401): [#def57]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1511: error[memleak]: Memory leak: ret
# 1509|           ret->architecture = strdup (src->architecture);
# 1510|           if (ret->architecture == NULL)
# 1511|->           return NULL;
# 1512|         }
# 1513|       if (src->variant)

Error: CPPCHECK_WARNING (CWE-401): [#def58]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1517: error[memleak]: Memory leak: ret
# 1515|           ret->variant = strdup (src->variant);
# 1516|           if (ret->variant == NULL)
# 1517|->           return NULL;
# 1518|         }
# 1519|       if (src->os)

Error: CPPCHECK_WARNING (CWE-401): [#def59]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1523: error[memleak]: Memory leak: ret
# 1521|           ret->os = strdup (src->os);
# 1522|           if (ret->os == NULL)
# 1523|->           return NULL;
# 1524|         }
# 1525|       if (src->os_version)

Error: CPPCHECK_WARNING (CWE-401): [#def60]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1529: error[memleak]: Memory leak: ret
# 1527|           ret->os_version = strdup (src->os_version);
# 1528|           if (ret->os_version == NULL)
# 1529|->           return NULL;
# 1530|         }
# 1531|       if (src->os_features)

Error: CPPCHECK_WARNING (CWE-401): [#def61]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:1536: error[memleak]: Memory leak: ret
# 1534|           ret->os_features = calloc (src->os_features_len + 1, sizeof (*ret->os_features));
# 1535|           if (ret->os_features == NULL)
# 1536|->           return NULL;
# 1537|           for (size_t i = 0; i < src->os_features_len; i++)
# 1538|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:151:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
#  149|         }
#  150|   
#  151|->     if (tree->type == yajl_t_object)
#  152|         {
#  153|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def63]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:370: error[memleak]: Memory leak: ret
#  368|           ret->media_type = strdup (src->media_type);
#  369|           if (ret->media_type == NULL)
#  370|->           return NULL;
#  371|         }
#  372|       ret->size = src->size;

Error: CPPCHECK_WARNING (CWE-401): [#def64]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:378: error[memleak]: Memory leak: ret
#  376|           ret->digest = strdup (src->digest);
#  377|           if (ret->digest == NULL)
#  378|->           return NULL;
#  379|         }
#  380|       if (src->urls)

Error: CPPCHECK_WARNING (CWE-401): [#def65]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:385: error[memleak]: Memory leak: ret
#  383|           ret->urls = calloc (src->urls_len + 1, sizeof (*ret->urls));
#  384|           if (ret->urls == NULL)
#  385|->           return NULL;
#  386|           for (size_t i = 0; i < src->urls_len; i++)
#  387|             {

Error: CPPCHECK_WARNING (CWE-401): [#def66]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c:86: error[memleak]: Memory leak: ret
#   84|           ret->keys = calloc (len + 1, sizeof (*ret->keys));
#   85|           if (ret->keys == NULL)
#   86|->           return NULL;
#   87|           ret->values = calloc (len + 1, sizeof (*ret->values));
#   88|           if (ret->values == NULL)

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c:126:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c:77:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c:77:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object'
#  124|           ptr->values = NULL;
#  125|         }
#  126|->     free (ptr);
#  127|   }
#  128|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:111:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  109|         }
#  110|   
#  111|->     if (tree->type == yajl_t_object)
#  112|         {
#  113|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def70]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:305: error[memleak]: Memory leak: ret
#  303|           ret->architecture = strdup (src->architecture);
#  304|           if (ret->architecture == NULL)
#  305|->           return NULL;
#  306|         }
#  307|       if (src->os)

Error: CPPCHECK_WARNING (CWE-401): [#def71]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:311: error[memleak]: Memory leak: ret
#  309|           ret->os = strdup (src->os);
#  310|           if (ret->os == NULL)
#  311|->           return NULL;
#  312|         }
#  313|       if (src->os_version)

Error: CPPCHECK_WARNING (CWE-401): [#def72]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:317: error[memleak]: Memory leak: ret
#  315|           ret->os_version = strdup (src->os_version);
#  316|           if (ret->os_version == NULL)
#  317|->           return NULL;
#  318|         }
#  319|       if (src->os_features)

Error: CPPCHECK_WARNING (CWE-401): [#def73]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:324: error[memleak]: Memory leak: ret
#  322|           ret->os_features = calloc (src->os_features_len + 1, sizeof (*ret->os_features));
#  323|           if (ret->os_features == NULL)
#  324|->           return NULL;
#  325|           for (size_t i = 0; i < src->os_features_len; i++)
#  326|             {

Error: CPPCHECK_WARNING (CWE-401): [#def74]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:603: error[memleak]: Memory leak: ret
#  601|           ret->media_type = strdup (src->media_type);
#  602|           if (ret->media_type == NULL)
#  603|->           return NULL;
#  604|         }
#  605|       ret->size = src->size;

Error: CPPCHECK_WARNING (CWE-401): [#def75]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:611: error[memleak]: Memory leak: ret
#  609|           ret->digest = strdup (src->digest);
#  610|           if (ret->digest == NULL)
#  611|->           return NULL;
#  612|         }
#  613|       if (src->urls)

Error: CPPCHECK_WARNING (CWE-401): [#def76]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:618: error[memleak]: Memory leak: ret
#  616|           ret->urls = calloc (src->urls_len + 1, sizeof (*ret->urls));
#  617|           if (ret->urls == NULL)
#  618|->           return NULL;
#  619|           for (size_t i = 0; i < src->urls_len; i++)
#  620|             {

Error: CPPCHECK_WARNING (CWE-401): [#def77]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:954: error[memleak]: Memory leak: ret
#  952|           ret->media_type = strdup (src->media_type);
#  953|           if (ret->media_type == NULL)
#  954|->           return NULL;
#  955|         }
#  956|       if (src->artifact_type)

Error: CPPCHECK_WARNING (CWE-401): [#def78]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:960: error[memleak]: Memory leak: ret
#  958|           ret->artifact_type = strdup (src->artifact_type);
#  959|           if (ret->artifact_type == NULL)
#  960|->           return NULL;
#  961|         }
#  962|       if (src->subject)

Error: CPPCHECK_WARNING (CWE-401): [#def79]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:966: error[memleak]: Memory leak: ret
#  964|           ret->subject = clone_image_spec_schema_content_descriptor (src->subject);
#  965|           if (ret->subject == NULL)
#  966|->           return NULL;
#  967|         }
#  968|       if (src->manifests)

Error: CPPCHECK_WARNING (CWE-401): [#def80]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:973: error[memleak]: Memory leak: ret
#  971|           ret->manifests = calloc (src->manifests_len + 1, sizeof (*ret->manifests));
#  972|           if (ret->manifests == NULL)
#  973|->           return NULL;
#  974|           for (size_t i = 0; i < src->manifests_len; i++)
#  975|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   41|         }
#   42|   
#   43|->     if (tree->type == yajl_t_object)
#   44|         {
#   45|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def82]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:152: error[memleak]: Memory leak: ret
#  150|           ret->image_layout_version = strdup (src->image_layout_version);
#  151|           if (ret->image_layout_version == NULL)
#  152|->           return NULL;
#  153|         }
#  154|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-401): [#def84]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:30:19: note: in expansion of macro 'YAJL_IS_NUMBER'
#  179|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  180|   
#  181|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  182|             ret->_residual = resi;
#  183|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'make_image_spec_schema_image_manifest_schema'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:30:19: note: in expansion of macro 'YAJL_IS_NUMBER'
#  179|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  180|   
#  181|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  182|             ret->_residual = resi;
#  183|         }

Error: CPPCHECK_WARNING (CWE-401): [#def86]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:349: error[memleak]: Memory leak: ret
#  347|           ret->media_type = strdup (src->media_type);
#  348|           if (ret->media_type == NULL)
#  349|->           return NULL;
#  350|         }
#  351|       if (src->artifact_type)

Error: CPPCHECK_WARNING (CWE-401): [#def87]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:355: error[memleak]: Memory leak: ret
#  353|           ret->artifact_type = strdup (src->artifact_type);
#  354|           if (ret->artifact_type == NULL)
#  355|->           return NULL;
#  356|         }
#  357|       if (src->config)

Error: CPPCHECK_WARNING (CWE-401): [#def88]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:361: error[memleak]: Memory leak: ret
#  359|           ret->config = clone_image_spec_schema_content_descriptor (src->config);
#  360|           if (ret->config == NULL)
#  361|->           return NULL;
#  362|         }
#  363|       if (src->subject)

Error: CPPCHECK_WARNING (CWE-401): [#def89]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:367: error[memleak]: Memory leak: ret
#  365|           ret->subject = clone_image_spec_schema_content_descriptor (src->subject);
#  366|           if (ret->subject == NULL)
#  367|->           return NULL;
#  368|         }
#  369|       if (src->layers)

Error: CPPCHECK_WARNING (CWE-401): [#def90]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:374: error[memleak]: Memory leak: ret
#  372|           ret->layers = calloc (src->layers_len + 1, sizeof (*ret->layers));
#  373|           if (ret->layers == NULL)
#  374|->           return NULL;
#  375|           for (size_t i = 0; i < src->layers_len; i++)
#  376|             {

Error: CPPCHECK_WARNING (CWE-401): [#def91]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:533: error[memleak]: Memory leak: ret
#  531|     if (ret->keys == NULL)
#  532|       {
#  533|->       return NULL;
#  534|       }
#  535|   

Error: CPPCHECK_WARNING (CWE-401): [#def92]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:539: error[memleak]: Memory leak: ret
#  537|     if (ret->values == NULL)
#  538|       {
#  539|->       return NULL;
#  540|       }
#  541|   

Error: CPPCHECK_WARNING (CWE-401): [#def93]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:611: error[memleak]: Memory leak: keys
#  609|     if (vals == NULL)
#  610|       {
#  611|->       return -1;
#  612|       }
#  613|   

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def96]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:782: error[memleak]: Memory leak: keys
#  780|     if (vals == NULL)
#  781|       {
#  782|->       return -1;
#  783|       }
#  784|   

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def103]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:1408: error[memleak]: Memory leak: keys
# 1406|     if (vals == NULL)
# 1407|       {
# 1408|->       return -1;
# 1409|       }
# 1410|   

Error: CPPCHECK_WARNING (CWE-401): [#def104]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:1414: error[memleak]: Memory leak: keys
# 1412|     if (new_value == NULL)
# 1413|       {
# 1414|->       return -1;
# 1415|       }
# 1416|   

Error: CPPCHECK_WARNING (CWE-401): [#def105]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:1414: error[memleak]: Memory leak: vals
# 1412|     if (new_value == NULL)
# 1413|       {
# 1414|->       return -1;
# 1415|       }
# 1416|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def106]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:1479:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.keys + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:6: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
# 1477|         for (i = 0; i < map->len; i++)
# 1478|           {
# 1479|->           free (map->keys[i]);
# 1480|             map->keys[i] = NULL;
# 1481|             free (map->values[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def107]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c:1481:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.values + i * 8'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
# 1479|             free (map->keys[i]);
# 1480|             map->keys[i] = NULL;
# 1481|->           free (map->values[i]);
# 1482|             map->values[i] = NULL;
# 1483|           }

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux_resources'
crun-1.18.2-build/crun-1.18.2/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): [#def113]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:322:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  320|       while (0);
#  321|   
#  322|->     if (tree->type == yajl_t_object)
#  323|         {
#  324|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:322:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx,  err)'
#  320|       while (0);
#  321|   
#  322|->     if (tree->type == yajl_t_object)
#  323|         {
#  324|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'clone_runtime_spec_schema_config_linux_resources'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:633:22: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_block_io(*src.block_io)'
#  631|       if (ret == NULL)
#  632|         return NULL;
#  633|->     ret->weight = src->weight;
#  634|       ret->weight_present = src->weight_present;
#  635|       ret->leaf_weight = src->leaf_weight;

Error: CPPCHECK_WARNING (CWE-401): [#def116]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:642: error[memleak]: Memory leak: ret
#  640|           ret->throttle_read_bps_device = calloc (src->throttle_read_bps_device_len + 1, sizeof (*ret->throttle_read_bps_device));
#  641|           if (ret->throttle_read_bps_device == NULL)
#  642|->           return NULL;
#  643|           for (size_t i = 0; i < src->throttle_read_bps_device_len; i++)
#  644|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:689:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  687|             }
#  688|         }
#  689|->     if (src->weight_device)
#  690|         {
#  691|           ret->weight_device_len = src->weight_device_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1107:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_cpu(*src.cpu)'
# 1105|       if (ret == NULL)
# 1106|         return NULL;
# 1107|->     if (src->cpus)
# 1108|         {
# 1109|           ret->cpus = strdup (src->cpus);

Error: CPPCHECK_WARNING (CWE-401): [#def119]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1111: error[memleak]: Memory leak: ret
# 1109|           ret->cpus = strdup (src->cpus);
# 1110|           if (ret->cpus == NULL)
# 1111|->           return NULL;
# 1112|         }
# 1113|       if (src->mems)

Error: CPPCHECK_WARNING (CWE-401): [#def120]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1117: error[memleak]: Memory leak: ret
# 1115|           ret->mems = strdup (src->mems);
# 1116|           if (ret->mems == NULL)
# 1117|->           return NULL;
# 1118|         }
# 1119|       ret->period = src->period;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1132:23: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1130|       ret->shares_present = src->shares_present;
# 1131|       ret->idle = src->idle;
# 1132|->     ret->idle_present = src->idle_present;
# 1133|       return move_ptr (ret);
# 1134|   }

Error: CPPCHECK_WARNING (CWE-401): [#def122]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1252: error[memleak]: Memory leak: ret
# 1250|           ret->page_size = strdup (src->page_size);
# 1251|           if (ret->page_size == NULL)
# 1252|->           return NULL;
# 1253|         }
# 1254|       ret->limit = src->limit;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1891:24: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_network(*src.network)'
# 1889|       if (ret == NULL)
# 1890|         return NULL;
# 1891|->     ret->class_id = src->class_id;
# 1892|       ret->class_id_present = src->class_id_present;
# 1893|       if (src->priorities)

Error: CPPCHECK_WARNING (CWE-401): [#def124]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1898: error[memleak]: Memory leak: ret
# 1896|           ret->priorities = calloc (src->priorities_len + 1, sizeof (*ret->priorities));
# 1897|           if (ret->priorities == NULL)
# 1898|->           return NULL;
# 1899|           for (size_t i = 0; i < src->priorities_len; i++)
# 1900|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1899:30: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1897|           if (ret->priorities == NULL)
# 1898|             return NULL;
# 1899|->         for (size_t i = 0; i < src->priorities_len; i++)
# 1900|             {
# 1901|               ret->priorities[i] = clone_runtime_spec_schema_defs_linux_network_interface_priority (src->priorities[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'clone_runtime_spec_schema_config_linux'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2325:20: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources(*src.resources)'
# 2323|       if (ret == NULL)
# 2324|         return NULL;
# 2325|->     ret->unified = clone_map_string_string (src->unified);
# 2326|       if (ret->unified == NULL)
# 2327|           return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def127]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2327: error[memleak]: Memory leak: ret
# 2325|       ret->unified = clone_map_string_string (src->unified);
# 2326|       if (ret->unified == NULL)
# 2327|->         return NULL;
# 2328|       if (src->devices)
# 2329|         {

Error: CPPCHECK_WARNING (CWE-401): [#def128]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2333: error[memleak]: Memory leak: ret
# 2331|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 2332|           if (ret->devices == NULL)
# 2333|->           return NULL;
# 2334|           for (size_t i = 0; i < src->devices_len; i++)
# 2335|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2384:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 2382|             return NULL;
# 2383|         }
# 2384|->     if (src->rdma)
# 2385|         {
# 2386|           ret->rdma = clone_runtime_spec_schema_config_linux_resources_rdma (src->rdma);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2811:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_seccomp(*src.seccomp)'
# 2809|       if (ret == NULL)
# 2810|         return NULL;
# 2811|->     if (src->default_action)
# 2812|         {
# 2813|           ret->default_action = strdup (src->default_action);

Error: CPPCHECK_WARNING (CWE-401): [#def131]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2815: error[memleak]: Memory leak: ret
# 2813|           ret->default_action = strdup (src->default_action);
# 2814|           if (ret->default_action == NULL)
# 2815|->           return NULL;
# 2816|         }
# 2817|       ret->default_errno_ret = src->default_errno_ret;

Error: CPPCHECK_WARNING (CWE-401): [#def132]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2824: error[memleak]: Memory leak: ret
# 2822|           ret->flags = calloc (src->flags_len + 1, sizeof (*ret->flags));
# 2823|           if (ret->flags == NULL)
# 2824|->           return NULL;
# 2825|           for (size_t i = 0; i < src->flags_len; i++)
# 2826|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2863:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 2861|             }
# 2862|         }
# 2863|->     if (src->syscalls)
# 2864|         {
# 2865|           ret->syscalls_len = src->syscalls_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3129:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_intel_rdt(*src.intel_rdt)'
# 3127|       if (ret == NULL)
# 3128|         return NULL;
# 3129|->     if (src->clos_id)
# 3130|         {
# 3131|           ret->clos_id = strdup (src->clos_id);

Error: CPPCHECK_WARNING (CWE-401): [#def135]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3133: error[memleak]: Memory leak: ret
# 3131|           ret->clos_id = strdup (src->clos_id);
# 3132|           if (ret->clos_id == NULL)
# 3133|->           return NULL;
# 3134|         }
# 3135|       if (src->l3cache_schema)

Error: CPPCHECK_WARNING (CWE-401): [#def136]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3139: error[memleak]: Memory leak: ret
# 3137|           ret->l3cache_schema = strdup (src->l3cache_schema);
# 3138|           if (ret->l3cache_schema == NULL)
# 3139|->           return NULL;
# 3140|         }
# 3141|       if (src->mem_bw_schema)

Error: CPPCHECK_WARNING (CWE-401): [#def137]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3145: error[memleak]: Memory leak: ret
# 3143|           ret->mem_bw_schema = strdup (src->mem_bw_schema);
# 3144|           if (ret->mem_bw_schema == NULL)
# 3145|->           return NULL;
# 3146|         }
# 3147|       ret->enable_cmt = src->enable_cmt;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3150:29: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 3148|       ret->enable_cmt_present = src->enable_cmt_present;
# 3149|       ret->enable_mbm = src->enable_mbm;
# 3150|->     ret->enable_mbm_present = src->enable_mbm_present;
# 3151|       return move_ptr (ret);
# 3152|   }

Error: CPPCHECK_WARNING (CWE-401): [#def139]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3168: error[memleak]: Memory leak: ret
# 3166|       ret->boottime = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "boottime", yajl_t_object), ctx, err);
# 3167|       if (ret->boottime == NULL && *err != 0)
# 3168|->       return NULL;
# 3169|       ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err);
# 3170|       if (ret->monotonic == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def140]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3171: error[memleak]: Memory leak: ret
# 3169|       ret->monotonic = make_runtime_spec_schema_defs_linux_time_offsets (get_val (tree, "monotonic", yajl_t_object), ctx, err);
# 3170|       if (ret->monotonic == NULL && *err != 0)
# 3171|->       return NULL;
# 3172|   
# 3173|       if (tree->type == yajl_t_object)

Error: CPPCHECK_WARNING (CWE-401): [#def141]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3184: error[memleak]: Memory leak: ret
# 3182|               resi = calloc (1, sizeof(*tree));
# 3183|               if (resi == NULL)
# 3184|->               return NULL;
# 3185|   
# 3186|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def142]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3191: error[memleak]: Memory leak: ret
# 3189|                 {
# 3190|                   yajl_tree_free (resi);
# 3191|->                 return NULL;
# 3192|                 }
# 3193|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def143]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3197: error[memleak]: Memory leak: ret
# 3195|                 {
# 3196|                   yajl_tree_free (resi);
# 3197|->                 return NULL;
# 3198|                 }
# 3199|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3293:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_time_offsets(*src.time_offsets)'
# 3291|       if (ret == NULL)
# 3292|         return NULL;
# 3293|->     if (src->boottime)
# 3294|         {
# 3295|           ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);

Error: CPPCHECK_WARNING (CWE-401): [#def145]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3297: error[memleak]: Memory leak: ret
# 3295|           ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);
# 3296|           if (ret->boottime == NULL)
# 3297|->           return NULL;
# 3298|         }
# 3299|       if (src->monotonic)

Error: CPPCHECK_WARNING (CWE-401): [#def146]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3303: error[memleak]: Memory leak: ret
# 3301|           ret->monotonic = clone_runtime_spec_schema_defs_linux_time_offsets (src->monotonic);
# 3302|           if (ret->monotonic == NULL)
# 3303|->           return NULL;
# 3304|         }
# 3305|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def147]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3993: error[memleak]: Memory leak: ret
# 3991|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 3992|           if (ret->devices == NULL)
# 3993|->           return NULL;
# 3994|           for (size_t i = 0; i < src->devices_len; i++)
# 3995|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
crun-1.18.2-build/crun-1.18.2/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): [#def149]
crun-1.18.2-build/crun-1.18.2/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: CPPCHECK_WARNING (CWE-401): [#def150]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:486: error[memleak]: Memory leak: ret
#  484|           ret->prestart = calloc (src->prestart_len + 1, sizeof (*ret->prestart));
#  485|           if (ret->prestart == NULL)
#  486|->           return NULL;
#  487|           for (size_t i = 0; i < src->prestart_len; i++)
#  488|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:612:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:579:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:591:29: note: in expansion of macro 'YAJL_IS_TRUE'
#  610|         }
#  611|   
#  612|->     if (tree->type == yajl_t_object)
#  613|         {
#  614|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def152]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:735: error[memleak]: Memory leak: ret
#  733|           ret->path = strdup (src->path);
#  734|           if (ret->path == NULL)
#  735|->           return NULL;
#  736|         }
#  737|       ret->readonly = src->readonly;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema_process'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:799:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_console_size(get_val(tree, "consoleSize", 3), ctx,  err)'
#  797|       while (0);
#  798|   
#  799|->     if (tree->type == yajl_t_object)
#  800|         {
#  801|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1048:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
# 1046|       while (0);
# 1047|   
# 1048|->     if (tree->type == yajl_t_object)
# 1049|         {
# 1050|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1048:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
# 1046|       while (0);
# 1047|   
# 1048|->     if (tree->type == yajl_t_object)
# 1049|         {
# 1050|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def156]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1233: error[memleak]: Memory leak: ret
# 1231|           ret->additional_gids = calloc (src->additional_gids_len + 1, sizeof (*ret->additional_gids));
# 1232|           if (ret->additional_gids == NULL)
# 1233|->           return NULL;
# 1234|           for (size_t i = 0; i < src->additional_gids_len; i++)
# 1235|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1391:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
# 1389|       while (0);
# 1390|   
# 1391|->     if (tree->type == yajl_t_object)
# 1392|         {
# 1393|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1391:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
# 1389|       while (0);
# 1390|   
# 1391|->     if (tree->type == yajl_t_object)
# 1392|         {
# 1393|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def159]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1686: error[memleak]: Memory leak: ret
# 1684|           ret->bounding = calloc (src->bounding_len + 1, sizeof (*ret->bounding));
# 1685|           if (ret->bounding == NULL)
# 1686|->           return NULL;
# 1687|           for (size_t i = 0; i < src->bounding_len; i++)
# 1688|             {

Error: CPPCHECK_WARNING (CWE-401): [#def160]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1939: error[memleak]: Memory leak: ret
# 1937|           ret->_class = strdup (src->_class);
# 1938|           if (ret->_class == NULL)
# 1939|->           return NULL;
# 1940|         }
# 1941|       ret->priority = src->priority;

Error: CPPCHECK_WARNING (CWE-401): [#def161]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2327: error[memleak]: Memory leak: ret
# 2325|           ret->policy = strdup (src->policy);
# 2326|           if (ret->policy == NULL)
# 2327|->           return NULL;
# 2328|         }
# 2329|       ret->nice = src->nice;

Error: CPPCHECK_WARNING (CWE-401): [#def162]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2338: error[memleak]: Memory leak: ret
# 2336|           ret->flags = calloc (src->flags_len + 1, sizeof (*ret->flags));
# 2337|           if (ret->flags == NULL)
# 2338|->           return NULL;
# 2339|           for (size_t i = 0; i < src->flags_len; i++)
# 2340|             {

Error: CPPCHECK_WARNING (CWE-401): [#def163]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2512: error[memleak]: Memory leak: ret
# 2510|           ret->type = strdup (src->type);
# 2511|           if (ret->type == NULL)
# 2512|->           return NULL;
# 2513|         }
# 2514|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def164]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3123: error[memleak]: Memory leak: ret
# 3121|           ret->args = calloc (src->args_len + 1, sizeof (*ret->args));
# 3122|           if (ret->args == NULL)
# 3123|->           return NULL;
# 3124|           for (size_t i = 0; i < src->args_len; i++)
# 3125|             {

Error: CPPCHECK_WARNING (CWE-401): [#def165]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3655: error[memleak]: Memory leak: ret
# 3653|           ret->oci_version = strdup (src->oci_version);
# 3654|           if (ret->oci_version == NULL)
# 3655|->           return NULL;
# 3656|         }
# 3657|       if (src->hooks)

Error: CPPCHECK_WARNING (CWE-401): [#def166]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3661: error[memleak]: Memory leak: ret
# 3659|           ret->hooks = clone_runtime_spec_schema_config_schema_hooks (src->hooks);
# 3660|           if (ret->hooks == NULL)
# 3661|->           return NULL;
# 3662|         }
# 3663|       ret->annotations = clone_map_string_string (src->annotations);

Error: CPPCHECK_WARNING (CWE-401): [#def167]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3665: error[memleak]: Memory leak: ret
# 3663|       ret->annotations = clone_map_string_string (src->annotations);
# 3664|       if (ret->annotations == NULL)
# 3665|->         return NULL;
# 3666|       if (src->hostname)
# 3667|         {

Error: CPPCHECK_WARNING (CWE-401): [#def168]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3670: error[memleak]: Memory leak: ret
# 3668|           ret->hostname = strdup (src->hostname);
# 3669|           if (ret->hostname == NULL)
# 3670|->           return NULL;
# 3671|         }
# 3672|       if (src->domainname)

Error: CPPCHECK_WARNING (CWE-401): [#def169]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3676: error[memleak]: Memory leak: ret
# 3674|           ret->domainname = strdup (src->domainname);
# 3675|           if (ret->domainname == NULL)
# 3676|->           return NULL;
# 3677|         }
# 3678|       if (src->mounts)

Error: CPPCHECK_WARNING (CWE-401): [#def170]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3683: error[memleak]: Memory leak: ret
# 3681|           ret->mounts = calloc (src->mounts_len + 1, sizeof (*ret->mounts));
# 3682|           if (ret->mounts == NULL)
# 3683|->           return NULL;
# 3684|           for (size_t i = 0; i < src->mounts_len; i++)
# 3685|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'make_runtime_spec_schema_config_solaris'
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-401): [#def172]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'clone_runtime_spec_schema_config_solaris'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:142:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_solaris_capped_cpu(*src.capped_cpu)'
#  140|       if (ret == NULL)
#  141|         return NULL;
#  142|->     if (src->ncpus)
#  143|         {
#  144|           ret->ncpus = strdup (src->ncpus);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:145:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  143|         {
#  144|           ret->ncpus = strdup (src->ncpus);
#  145|->         if (ret->ncpus == NULL)
#  146|             return NULL;
#  147|         }

Error: CPPCHECK_WARNING (CWE-401): [#def174]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:146: error[memleak]: Memory leak: ret
#  144|           ret->ncpus = strdup (src->ncpus);
#  145|           if (ret->ncpus == NULL)
#  146|->           return NULL;
#  147|         }
#  148|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: note: in expansion of macro 'YAJL_GET_STRING'
#  186|       while (0);
#  187|   
#  188|->     if (tree->type == yajl_t_object)
#  189|         {
#  190|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)'
#  186|       while (0);
#  187|   
#  188|->     if (tree->type == yajl_t_object)
#  189|         {
#  190|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'clone_runtime_spec_schema_config_solaris'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:308:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_solaris_capped_memory(*src.capped_memory)'
#  306|       if (ret == NULL)
#  307|         return NULL;
#  308|->     if (src->physical)
#  309|         {
#  310|           ret->physical = strdup (src->physical);

Error: CPPCHECK_WARNING (CWE-401): [#def178]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:312: error[memleak]: Memory leak: ret
#  310|           ret->physical = strdup (src->physical);
#  311|           if (ret->physical == NULL)
#  312|->           return NULL;
#  313|         }
#  314|       if (src->swap)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:314:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  312|             return NULL;
#  313|         }
#  314|->     if (src->swap)
#  315|         {
#  316|           ret->swap = strdup (src->swap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:317:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  315|         {
#  316|           ret->swap = strdup (src->swap);
#  317|->         if (ret->swap == NULL)
#  318|             return NULL;
#  319|         }

Error: CPPCHECK_WARNING (CWE-401): [#def181]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:318: error[memleak]: Memory leak: ret
#  316|           ret->swap = strdup (src->swap);
#  317|           if (ret->swap == NULL)
#  318|->           return NULL;
#  319|         }
#  320|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: note: in expansion of macro 'YAJL_GET_STRING'
#  408|         {
#  409|           yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
#  410|->         if (val != NULL)
#  411|             {
#  412|               char *str = YAJL_GET_STRING (val);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
#  408|         {
#  409|           yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
#  410|->         if (val != NULL)
#  411|             {
#  412|               char *str = YAJL_GET_STRING (val);

Error: CPPCHECK_WARNING (CWE-401): [#def184]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:555: error[memleak]: Memory leak: ret
#  553|           ret->linkname = strdup (src->linkname);
#  554|           if (ret->linkname == NULL)
#  555|->           return NULL;
#  556|         }
#  557|       if (src->lower_link)

Error: CPPCHECK_WARNING (CWE-401): [#def185]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:561: error[memleak]: Memory leak: ret
#  559|           ret->lower_link = strdup (src->lower_link);
#  560|           if (ret->lower_link == NULL)
#  561|->           return NULL;
#  562|         }
#  563|       if (src->allowed_address)

Error: CPPCHECK_WARNING (CWE-401): [#def186]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:567: error[memleak]: Memory leak: ret
#  565|           ret->allowed_address = strdup (src->allowed_address);
#  566|           if (ret->allowed_address == NULL)
#  567|->           return NULL;
#  568|         }
#  569|       if (src->configure_allowed_address)

Error: CPPCHECK_WARNING (CWE-401): [#def187]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:573: error[memleak]: Memory leak: ret
#  571|           ret->configure_allowed_address = strdup (src->configure_allowed_address);
#  572|           if (ret->configure_allowed_address == NULL)
#  573|->           return NULL;
#  574|         }
#  575|       if (src->defrouter)

Error: CPPCHECK_WARNING (CWE-401): [#def188]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:579: error[memleak]: Memory leak: ret
#  577|           ret->defrouter = strdup (src->defrouter);
#  578|           if (ret->defrouter == NULL)
#  579|->           return NULL;
#  580|         }
#  581|       if (src->mac_address)

Error: CPPCHECK_WARNING (CWE-401): [#def189]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:585: error[memleak]: Memory leak: ret
#  583|           ret->mac_address = strdup (src->mac_address);
#  584|           if (ret->mac_address == NULL)
#  585|->           return NULL;
#  586|         }
#  587|       if (src->link_protection)

Error: CPPCHECK_WARNING (CWE-401): [#def190]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:591: error[memleak]: Memory leak: ret
#  589|           ret->link_protection = strdup (src->link_protection);
#  590|           if (ret->link_protection == NULL)
#  591|->           return NULL;
#  592|         }
#  593|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def191]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:881: error[memleak]: Memory leak: ret
#  879|           ret->milestone = strdup (src->milestone);
#  880|           if (ret->milestone == NULL)
#  881|->           return NULL;
#  882|         }
#  883|       if (src->limitpriv)

Error: CPPCHECK_WARNING (CWE-401): [#def192]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:887: error[memleak]: Memory leak: ret
#  885|           ret->limitpriv = strdup (src->limitpriv);
#  886|           if (ret->limitpriv == NULL)
#  887|->           return NULL;
#  888|         }
#  889|       if (src->max_shm_memory)

Error: CPPCHECK_WARNING (CWE-401): [#def193]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:893: error[memleak]: Memory leak: ret
#  891|           ret->max_shm_memory = strdup (src->max_shm_memory);
#  892|           if (ret->max_shm_memory == NULL)
#  893|->           return NULL;
#  894|         }
#  895|       if (src->capped_cpu)

Error: CPPCHECK_WARNING (CWE-401): [#def194]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:899: error[memleak]: Memory leak: ret
#  897|           ret->capped_cpu = clone_runtime_spec_schema_config_solaris_capped_cpu (src->capped_cpu);
#  898|           if (ret->capped_cpu == NULL)
#  899|->           return NULL;
#  900|         }
#  901|       if (src->capped_memory)

Error: CPPCHECK_WARNING (CWE-401): [#def195]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:905: error[memleak]: Memory leak: ret
#  903|           ret->capped_memory = clone_runtime_spec_schema_config_solaris_capped_memory (src->capped_memory);
#  904|           if (ret->capped_memory == NULL)
#  905|->           return NULL;
#  906|         }
#  907|       if (src->anet)

Error: CPPCHECK_WARNING (CWE-401): [#def196]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:912: error[memleak]: Memory leak: ret
#  910|           ret->anet = calloc (src->anet_len + 1, sizeof (*ret->anet));
#  911|           if (ret->anet == NULL)
#  912|->           return NULL;
#  913|           for (size_t i = 0; i < src->anet_len; i++)
#  914|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:69:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#   67|         }
#   68|   
#   69|->     if (tree->type == yajl_t_object)
#   70|         {
#   71|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'clone_runtime_spec_schema_config_vm'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:214:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_hypervisor(*src.hypervisor)'
#  212|       if (ret == NULL)
#  213|         return NULL;
#  214|->     if (src->path)
#  215|         {
#  216|           ret->path = strdup (src->path);

Error: CPPCHECK_WARNING (CWE-401): [#def199]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:218: error[memleak]: Memory leak: ret
#  216|           ret->path = strdup (src->path);
#  217|           if (ret->path == NULL)
#  218|->           return NULL;
#  219|         }
#  220|       if (src->parameters)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:220:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  218|             return NULL;
#  219|         }
#  220|->     if (src->parameters)
#  221|         {
#  222|           ret->parameters_len = src->parameters_len;

Error: CPPCHECK_WARNING (CWE-401): [#def201]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:225: error[memleak]: Memory leak: ret
#  223|           ret->parameters = calloc (src->parameters_len + 1, sizeof (*ret->parameters));
#  224|           if (ret->parameters == NULL)
#  225|->           return NULL;
#  226|           for (size_t i = 0; i < src->parameters_len; i++)
#  227|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:226:30: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  224|           if (ret->parameters == NULL)
#  225|             return NULL;
#  226|->         for (size_t i = 0; i < src->parameters_len; i++)
#  227|             {
#  228|               if (src->parameters[i])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:308:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: note: in expansion of macro 'YAJL_GET_STRING'
#  306|         }
#  307|   
#  308|->     if (tree->type == yajl_t_object)
#  309|         {
#  310|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'clone_runtime_spec_schema_config_vm'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:468:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_kernel(*src.kernel)'
#  466|       if (ret == NULL)
#  467|         return NULL;
#  468|->     if (src->path)
#  469|         {
#  470|           ret->path = strdup (src->path);

Error: CPPCHECK_WARNING (CWE-401): [#def205]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:472: error[memleak]: Memory leak: ret
#  470|           ret->path = strdup (src->path);
#  471|           if (ret->path == NULL)
#  472|->           return NULL;
#  473|         }
#  474|       if (src->parameters)

Error: CPPCHECK_WARNING (CWE-401): [#def206]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:479: error[memleak]: Memory leak: ret
#  477|           ret->parameters = calloc (src->parameters_len + 1, sizeof (*ret->parameters));
#  478|           if (ret->parameters == NULL)
#  479|->           return NULL;
#  480|           for (size_t i = 0; i < src->parameters_len; i++)
#  481|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:490:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  488|             }
#  489|         }
#  490|->     if (src->initrd)
#  491|         {
#  492|           ret->initrd = strdup (src->initrd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:668:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_image(*src.image)'
#  666|       if (ret == NULL)
#  667|         return NULL;
#  668|->     if (src->path)
#  669|         {
#  670|           ret->path = strdup (src->path);

Error: CPPCHECK_WARNING (CWE-401): [#def209]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:672: error[memleak]: Memory leak: ret
#  670|           ret->path = strdup (src->path);
#  671|           if (ret->path == NULL)
#  672|->           return NULL;
#  673|         }
#  674|       if (src->format)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:674:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  672|             return NULL;
#  673|         }
#  674|->     if (src->format)
#  675|         {
#  676|           ret->format = strdup (src->format);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:677:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  675|         {
#  676|           ret->format = strdup (src->format);
#  677|->         if (ret->format == NULL)
#  678|             return NULL;
#  679|         }

Error: CPPCHECK_WARNING (CWE-401): [#def212]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:678: error[memleak]: Memory leak: ret
#  676|           ret->format = strdup (src->format);
#  677|           if (ret->format == NULL)
#  678|->           return NULL;
#  679|         }
#  680|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def213]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:697: error[memleak]: Memory leak: ret
#  695|       ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err);
#  696|       if (ret->hypervisor == NULL && *err != 0)
#  697|->       return NULL;
#  698|       ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
#  699|       if (ret->kernel == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def214]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:700: error[memleak]: Memory leak: ret
#  698|       ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
#  699|       if (ret->kernel == NULL && *err != 0)
#  700|->       return NULL;
#  701|       ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
#  702|       if (ret->image == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def215]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:703: error[memleak]: Memory leak: ret
#  701|       ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
#  702|       if (ret->image == NULL && *err != 0)
#  703|->       return NULL;
#  704|       if (ret->kernel == NULL)
#  705|         {

Error: CPPCHECK_WARNING (CWE-401): [#def216]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:708: error[memleak]: Memory leak: ret
#  706|           if (asprintf (err, "Required field '%s' not present",  "kernel") < 0)
#  707|               *err = strdup ("error allocating memory");
#  708|->         return NULL;
#  709|         }
#  710|   

Error: CPPCHECK_WARNING (CWE-401): [#def217]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:722: error[memleak]: Memory leak: ret
#  720|               resi = calloc (1, sizeof(*tree));
#  721|               if (resi == NULL)
#  722|->               return NULL;
#  723|   
#  724|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def218]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:729: error[memleak]: Memory leak: ret
#  727|                 {
#  728|                   yajl_tree_free (resi);
#  729|->                 return NULL;
#  730|                 }
#  731|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def219]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:735: error[memleak]: Memory leak: ret
#  733|                 {
#  734|                   yajl_tree_free (resi);
#  735|->                 return NULL;
#  736|                 }
#  737|             }

Error: CPPCHECK_WARNING (CWE-401): [#def220]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:850: error[memleak]: Memory leak: ret
#  848|           ret->hypervisor = clone_runtime_spec_schema_config_vm_hypervisor (src->hypervisor);
#  849|           if (ret->hypervisor == NULL)
#  850|->           return NULL;
#  851|         }
#  852|       if (src->kernel)

Error: CPPCHECK_WARNING (CWE-401): [#def221]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:856: error[memleak]: Memory leak: ret
#  854|           ret->kernel = clone_runtime_spec_schema_config_vm_kernel (src->kernel);
#  855|           if (ret->kernel == NULL)
#  856|->           return NULL;
#  857|         }
#  858|       if (src->image)

Error: CPPCHECK_WARNING (CWE-401): [#def222]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:862: error[memleak]: Memory leak: ret
#  860|           ret->image = clone_runtime_spec_schema_config_vm_image (src->image);
#  861|           if (ret->image == NULL)
#  862|->           return NULL;
#  863|         }
#  864|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources'
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-401): [#def224]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:234:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx,  err)'
#  232|       while (0);
#  233|   
#  234|->     if (tree->type == yajl_t_object)
#  235|         {
#  236|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:282:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  280|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  281|   
#  282|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  283|             ret->_residual = resi;
#  284|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_cpu'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:282:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
#  280|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  281|   
#  282|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  283|             ret->_residual = resi;
#  284|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:451:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_storage(get_val(tree, "storage", 3), ctx,  err)'
#  449|       while (0);
#  450|   
#  451|->     if (tree->type == yajl_t_object)
#  452|         {
#  453|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:499:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  497|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  498|   
#  499|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  500|             ret->_residual = resi;
#  501|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows_resources_storage'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:499:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
#  497|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  498|   
#  499|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  500|             ret->_residual = resi;
#  501|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'make_runtime_spec_schema_config_windows'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:602:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx,  err)'
#  600|         return NULL;
#  601|       ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
#  602|->     if (ret->memory == NULL && *err != 0)
#  603|         return NULL;
#  604|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);

Error: CPPCHECK_WARNING (CWE-401): [#def231]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:603: error[memleak]: Memory leak: ret
#  601|       ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
#  602|       if (ret->memory == NULL && *err != 0)
#  603|->       return NULL;
#  604|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
#  605|       if (ret->cpu == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def232]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:606: error[memleak]: Memory leak: ret
#  604|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
#  605|       if (ret->cpu == NULL && *err != 0)
#  606|->       return NULL;
#  607|       ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
#  608|       if (ret->storage == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def233]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:609: error[memleak]: Memory leak: ret
#  607|       ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
#  608|       if (ret->storage == NULL && *err != 0)
#  609|->       return NULL;
#  610|   
#  611|       if (tree->type == yajl_t_object)

Error: CPPCHECK_WARNING (CWE-401): [#def234]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:622: error[memleak]: Memory leak: ret
#  620|               resi = calloc (1, sizeof(*tree));
#  621|               if (resi == NULL)
#  622|->               return NULL;
#  623|   
#  624|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def235]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:629: error[memleak]: Memory leak: ret
#  627|                 {
#  628|                   yajl_tree_free (resi);
#  629|->                 return NULL;
#  630|                 }
#  631|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def236]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:635: error[memleak]: Memory leak: ret
#  633|                 {
#  634|                   yajl_tree_free (resi);
#  635|->                 return NULL;
#  636|                 }
#  637|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c: scope_hint: In function 'clone_runtime_spec_schema_config_windows'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:746:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_resources(*src.resources)'
#  744|       if (ret == NULL)
#  745|         return NULL;
#  746|->     if (src->memory)
#  747|         {
#  748|           ret->memory = clone_runtime_spec_schema_config_windows_resources_memory (src->memory);

Error: CPPCHECK_WARNING (CWE-401): [#def238]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:750: error[memleak]: Memory leak: ret
#  748|           ret->memory = clone_runtime_spec_schema_config_windows_resources_memory (src->memory);
#  749|           if (ret->memory == NULL)
#  750|->           return NULL;
#  751|         }
#  752|       if (src->cpu)

Error: CPPCHECK_WARNING (CWE-401): [#def239]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:756: error[memleak]: Memory leak: ret
#  754|           ret->cpu = clone_runtime_spec_schema_config_windows_resources_cpu (src->cpu);
#  755|           if (ret->cpu == NULL)
#  756|->           return NULL;
#  757|         }
#  758|       if (src->storage)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:758:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  756|             return NULL;
#  757|         }
#  758|->     if (src->storage)
#  759|         {
#  760|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:761:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  759|         {
#  760|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);
#  761|->         if (ret->storage == NULL)
#  762|             return NULL;
#  763|         }

Error: CPPCHECK_WARNING (CWE-401): [#def242]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:762: error[memleak]: Memory leak: ret
#  760|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);
#  761|           if (ret->storage == NULL)
#  762|->           return NULL;
#  763|         }
#  764|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def243]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1089:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_network(*src.network)'
# 1087|       if (ret == NULL)
# 1088|         return NULL;
# 1089|->     if (src->endpoint_list)
# 1090|         {
# 1091|           ret->endpoint_list_len = src->endpoint_list_len;

Error: CPPCHECK_WARNING (CWE-401): [#def244]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1094: error[memleak]: Memory leak: ret
# 1092|           ret->endpoint_list = calloc (src->endpoint_list_len + 1, sizeof (*ret->endpoint_list));
# 1093|           if (ret->endpoint_list == NULL)
# 1094|->           return NULL;
# 1095|           for (size_t i = 0; i < src->endpoint_list_len; i++)
# 1096|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1129:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1127|             return NULL;
# 1128|         }
# 1129|->     if (src->network_namespace)
# 1130|         {
# 1131|           ret->network_namespace = strdup (src->network_namespace);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1321:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_hyperv(*src.hyperv)'
# 1319|       if (ret == NULL)
# 1320|         return NULL;
# 1321|->     if (src->utility_vm_path)
# 1322|         {
# 1323|           ret->utility_vm_path = strdup (src->utility_vm_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1324:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1322|         {
# 1323|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1324|->         if (ret->utility_vm_path == NULL)
# 1325|             return NULL;
# 1326|         }

Error: CPPCHECK_WARNING (CWE-401): [#def248]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1325: error[memleak]: Memory leak: ret
# 1323|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1324|           if (ret->utility_vm_path == NULL)
# 1325|->           return NULL;
# 1326|         }
# 1327|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def249]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1709: error[memleak]: Memory leak: ret
# 1707|           ret->layer_folders = calloc (src->layer_folders_len + 1, sizeof (*ret->layer_folders));
# 1708|           if (ret->layer_folders == NULL)
# 1709|->           return NULL;
# 1710|           for (size_t i = 0; i < src->layer_folders_len; i++)
# 1711|             {

Error: CPPCHECK_WARNING (CWE-401): [#def250]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_zos.c:181: error[memleak]: Memory leak: ret
#  179|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
#  180|           if (ret->devices == NULL)
#  181|->           return NULL;
#  182|           for (size_t i = 0; i < src->devices_len; i++)
#  183|             {

Error: CPPCHECK_WARNING (CWE-401): [#def251]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:319: error[memleak]: Memory leak: ret
#  317|           ret->path = strdup (src->path);
#  318|           if (ret->path == NULL)
#  319|->           return NULL;
#  320|         }
#  321|       if (src->args)

Error: CPPCHECK_WARNING (CWE-401): [#def252]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:326: error[memleak]: Memory leak: ret
#  324|           ret->args = calloc (src->args_len + 1, sizeof (*ret->args));
#  325|           if (ret->args == NULL)
#  326|->           return NULL;
#  327|           for (size_t i = 0; i < src->args_len; i++)
#  328|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_mount'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:437:13: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_id_mapping(val,  ctx,  err)'
#  435|       while (0);
#  436|   
#  437|->     if (tree->type == yajl_t_object)
#  438|         {
#  439|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:485:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  483|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  484|   
#  485|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  486|             ret->_residual = resi;
#  487|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c: scope_hint: In function 'make_runtime_spec_schema_defs_id_mapping'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:485:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
#  483|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  484|   
#  485|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  486|             ret->_residual = resi;
#  487|         }

Error: CPPCHECK_WARNING (CWE-401): [#def256]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:957: error[memleak]: Memory leak: ret
#  955|           ret->source = strdup (src->source);
#  956|           if (ret->source == NULL)
#  957|->           return NULL;
#  958|         }
#  959|       if (src->destination)

Error: CPPCHECK_WARNING (CWE-401): [#def257]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:963: error[memleak]: Memory leak: ret
#  961|           ret->destination = strdup (src->destination);
#  962|           if (ret->destination == NULL)
#  963|->           return NULL;
#  964|         }
#  965|       if (src->options)

Error: CPPCHECK_WARNING (CWE-401): [#def258]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs.c:970: error[memleak]: Memory leak: ret
#  968|           ret->options = calloc (src->options_len + 1, sizeof (*ret->options));
#  969|           if (ret->options == NULL)
#  970|->           return NULL;
#  971|           for (size_t i = 0; i < src->options_len; i++)
#  972|             {

Error: CPPCHECK_WARNING (CWE-401): [#def259]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:212: error[memleak]: Memory leak: ret
#  210|           ret->domain = strdup (src->domain);
#  211|           if (ret->domain == NULL)
#  212|->           return NULL;
#  213|         }
#  214|       if (src->flags)

Error: CPPCHECK_WARNING (CWE-401): [#def260]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:219: error[memleak]: Memory leak: ret
#  217|           ret->flags = calloc (src->flags_len + 1, sizeof (*ret->flags));
#  218|           if (ret->flags == NULL)
#  219|->           return NULL;
#  220|           for (size_t i = 0; i < src->flags_len; i++)
#  221|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def261]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:330:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: note: in expansion of macro 'YAJL_GET_STRING'
#  328|         }
#  329|   
#  330|->     if (tree->type == yajl_t_object)
#  331|         {
#  332|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:379:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: note: in expansion of macro 'YAJL_GET_STRING'
#  377|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  378|   
#  379|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  380|             ret->_residual = resi;
#  381|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'clone_runtime_spec_schema_defs_linux_syscall'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:474:21: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_defs_linux_syscall_arg(*<unknown>)'
#  472|       if (ret == NULL)
#  473|         return NULL;
#  474|->     ret->index = src->index;
#  475|       ret->index_present = src->index_present;
#  476|       ret->value = src->value;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:483:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  481|         {
#  482|           ret->op = strdup (src->op);
#  483|->         if (ret->op == NULL)
#  484|             return NULL;
#  485|         }

Error: CPPCHECK_WARNING (CWE-401): [#def265]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:484: error[memleak]: Memory leak: ret
#  482|           ret->op = strdup (src->op);
#  483|           if (ret->op == NULL)
#  484|->           return NULL;
#  485|         }
#  486|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def266]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:798: error[memleak]: Memory leak: ret
#  796|           ret->names = calloc (src->names_len + 1, sizeof (*ret->names));
#  797|           if (ret->names == NULL)
#  798|->           return NULL;
#  799|           for (size_t i = 0; i < src->names_len; i++)
#  800|             {

Error: CPPCHECK_WARNING (CWE-401): [#def267]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1181: error[memleak]: Memory leak: ret
# 1179|           ret->type = strdup (src->type);
# 1180|           if (ret->type == NULL)
# 1181|->           return NULL;
# 1182|         }
# 1183|       if (src->path)

Error: CPPCHECK_WARNING (CWE-401): [#def268]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1187: error[memleak]: Memory leak: ret
# 1185|           ret->path = strdup (src->path);
# 1186|           if (ret->path == NULL)
# 1187|->           return NULL;
# 1188|         }
# 1189|       ret->file_mode = src->file_mode;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_block_io_device'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1306:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1304|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1305|   
# 1306|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1307|             ret->_residual = resi;
# 1308|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1532:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1530|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1531|   
# 1532|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1533|             ret->_residual = resi;
# 1534|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1763:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 1761|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1762|   
# 1763|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1764|             ret->_residual = resi;
# 1765|         }

Error: CPPCHECK_WARNING (CWE-401): [#def272]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2119: error[memleak]: Memory leak: ret
# 2117|           ret->type = strdup (src->type);
# 2118|           if (ret->type == NULL)
# 2119|->           return NULL;
# 2120|         }
# 2121|       ret->major = src->major;

Error: CPPCHECK_WARNING (CWE-401): [#def273]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2129: error[memleak]: Memory leak: ret
# 2127|           ret->access = strdup (src->access);
# 2128|           if (ret->access == NULL)
# 2129|->           return NULL;
# 2130|         }
# 2131|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_network_interface_priority'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2234:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2151:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2232|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2233|   
# 2234|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2235|             ret->_residual = resi;
# 2236|         }

Error: CPPCHECK_WARNING (CWE-401): [#def275]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2309: error[memleak]: Memory leak: ret
# 2307|           ret->name = strdup (src->name);
# 2308|           if (ret->name == NULL)
# 2309|->           return NULL;
# 2310|         }
# 2311|       ret->priority = src->priority;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_rdma'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2420:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2418|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2419|   
# 2420|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2421|             ret->_residual = resi;
# 2422|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_namespace_reference'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2586:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2513:25: note: in expansion of macro 'YAJL_GET_STRING'
# 2584|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2585|   
# 2586|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2587|             ret->_residual = resi;
# 2588|         }

Error: CPPCHECK_WARNING (CWE-401): [#def278]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2663: error[memleak]: Memory leak: ret
# 2661|           ret->type = strdup (src->type);
# 2662|           if (ret->type == NULL)
# 2663|->           return NULL;
# 2664|         }
# 2665|       if (src->path)

Error: CPPCHECK_WARNING (CWE-401): [#def279]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2669: error[memleak]: Memory leak: ret
# 2667|           ret->path = strdup (src->path);
# 2668|           if (ret->path == NULL)
# 2669|->           return NULL;
# 2670|         }
# 2671|       return move_ptr (ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_time_offsets'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2778:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
# 2776|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2777|   
# 2778|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2779|             ret->_residual = resi;
# 2780|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def281]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c: scope_hint: In function 'make_runtime_spec_schema_defs_windows_device'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  106|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  107|   
#  108|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  109|             ret->_residual = resi;
#  110|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  106|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  107|   
#  108|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  109|             ret->_residual = resi;
#  110|         }

Error: CPPCHECK_WARNING (CWE-401): [#def283]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:185: error[memleak]: Memory leak: ret
#  183|           ret->id = strdup (src->id);
#  184|           if (ret->id == NULL)
#  185|->           return NULL;
#  186|         }
#  187|       if (src->id_type)

Error: CPPCHECK_WARNING (CWE-401): [#def284]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:191: error[memleak]: Memory leak: ret
#  189|           ret->id_type = strdup (src->id_type);
#  190|           if (ret->id_type == NULL)
#  191|->           return NULL;
#  192|         }
#  193|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def285]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:360: error[memleak]: Memory leak: ret
#  358|           ret->path = strdup (src->path);
#  359|           if (ret->path == NULL)
#  360|->           return NULL;
#  361|         }
#  362|       if (src->type)

Error: CPPCHECK_WARNING (CWE-401): [#def286]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:366: error[memleak]: Memory leak: ret
#  364|           ret->type = strdup (src->type);
#  365|           if (ret->type == NULL)
#  366|->           return NULL;
#  367|         }
#  368|       ret->major = src->major;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c: scope_hint: In function 'clone_runtime_spec_schema_features_linux'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:759:23: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_features_linux_seccomp(*src.seccomp)'
#  757|       if (ret == NULL)
#  758|         return NULL;
#  759|->     ret->enabled = src->enabled;
#  760|       ret->enabled_present = src->enabled_present;
#  761|       if (src->actions)

Error: CPPCHECK_WARNING (CWE-401): [#def288]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:766: error[memleak]: Memory leak: ret
#  764|           ret->actions = calloc (src->actions_len + 1, sizeof (*ret->actions));
#  765|           if (ret->actions == NULL)
#  766|->           return NULL;
#  767|           for (size_t i = 0; i < src->actions_len; i++)
#  768|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:825:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  823|             }
#  824|         }
#  825|->     if (src->supported_flags)
#  826|         {
#  827|           ret->supported_flags_len = src->supported_flags_len;

Error: CPPCHECK_WARNING (CWE-401): [#def290]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1422: error[memleak]: Memory leak: ret
# 1420|       ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1421|       if (ret->idmap == NULL && *err != 0)
# 1422|->       return NULL;
# 1423|   
# 1424|       if (tree->type == yajl_t_object)

Error: CPPCHECK_WARNING (CWE-401): [#def291]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1435: error[memleak]: Memory leak: ret
# 1433|               resi = calloc (1, sizeof(*tree));
# 1434|               if (resi == NULL)
# 1435|->               return NULL;
# 1436|   
# 1437|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def292]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1442: error[memleak]: Memory leak: ret
# 1440|                 {
# 1441|                   yajl_tree_free (resi);
# 1442|->                 return NULL;
# 1443|                 }
# 1444|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def293]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1448: error[memleak]: Memory leak: ret
# 1446|                 {
# 1447|                   yajl_tree_free (resi);
# 1448|->                 return NULL;
# 1449|                 }
# 1450|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def294]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1529:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_features_linux_mount_extensions(*src.mount_extensions)'
# 1527|       if (ret == NULL)
# 1528|         return NULL;
# 1529|->     if (src->idmap)
# 1530|         {
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1532:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1530|         {
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1532|->         if (ret->idmap == NULL)
# 1533|             return NULL;
# 1534|         }

Error: CPPCHECK_WARNING (CWE-401): [#def296]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1533: error[memleak]: Memory leak: ret
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1532|           if (ret->idmap == NULL)
# 1533|->           return NULL;
# 1534|         }
# 1535|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def297]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1886: error[memleak]: Memory leak: ret
# 1884|           ret->namespaces = calloc (src->namespaces_len + 1, sizeof (*ret->namespaces));
# 1885|           if (ret->namespaces == NULL)
# 1886|->           return NULL;
# 1887|           for (size_t i = 0; i < src->namespaces_len; i++)
# 1888|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:160:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  158|         }
#  159|   
#  160|->     if (tree->type == yajl_t_object)
#  161|         {
#  162|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'make_runtime_spec_schema_features_schema'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  210|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  211|   
#  212|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  213|             ret->_residual = resi;
#  214|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
#  210|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  211|   
#  212|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  213|             ret->_residual = resi;
#  214|         }

Error: CPPCHECK_WARNING (CWE-401): [#def301]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:431: error[memleak]: Memory leak: ret
#  429|           ret->oci_version_min = strdup (src->oci_version_min);
#  430|           if (ret->oci_version_min == NULL)
#  431|->           return NULL;
#  432|         }
#  433|       if (src->oci_version_max)

Error: CPPCHECK_WARNING (CWE-401): [#def302]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:437: error[memleak]: Memory leak: ret
#  435|           ret->oci_version_max = strdup (src->oci_version_max);
#  436|           if (ret->oci_version_max == NULL)
#  437|->           return NULL;
#  438|         }
#  439|       if (src->hooks)

Error: CPPCHECK_WARNING (CWE-401): [#def303]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:444: error[memleak]: Memory leak: ret
#  442|           ret->hooks = calloc (src->hooks_len + 1, sizeof (*ret->hooks));
#  443|           if (ret->hooks == NULL)
#  444|->           return NULL;
#  445|           for (size_t i = 0; i < src->hooks_len; i++)
#  446|             {

Error: CPPCHECK_WARNING (CWE-401): [#def304]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:316: error[memleak]: Memory leak: ret
#  314|           ret->oci_version = strdup (src->oci_version);
#  315|           if (ret->oci_version == NULL)
#  316|->           return NULL;
#  317|         }
#  318|       if (src->id)

Error: CPPCHECK_WARNING (CWE-401): [#def305]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:322: error[memleak]: Memory leak: ret
#  320|           ret->id = strdup (src->id);
#  321|           if (ret->id == NULL)
#  322|->           return NULL;
#  323|         }
#  324|       if (src->status)

Error: CPPCHECK_WARNING (CWE-401): [#def306]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:328: error[memleak]: Memory leak: ret
#  326|           ret->status = strdup (src->status);
#  327|           if (ret->status == NULL)
#  328|->           return NULL;
#  329|         }
#  330|       ret->pid = src->pid;

Error: CPPCHECK_WARNING (CWE-401): [#def307]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:336: error[memleak]: Memory leak: ret
#  334|           ret->bundle = strdup (src->bundle);
#  335|           if (ret->bundle == NULL)
#  336|->           return NULL;
#  337|         }
#  338|       ret->annotations = clone_map_string_string (src->annotations);

Error: CPPCHECK_WARNING (CWE-401): [#def308]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_state_schema.c:340: error[memleak]: Memory leak: ret
#  338|       ret->annotations = clone_map_string_string (src->annotations);
#  339|       if (ret->annotations == NULL)
#  340|->         return NULL;
#  341|       return move_ptr (ret);
#  342|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:48:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:48:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:48:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def310]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:855:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:855:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:855:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def311]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c: scope_hint: In function 'image_spec_schema_content_descriptor_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_content_descriptor(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:63:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def312]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_index_schema_manifests_platform(get_val(tree, "platform", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def313]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c: scope_hint: In function 'image_spec_schema_image_layout_schema_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_layout_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def314]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_root(get_val(tree, "root", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:579:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:579:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:591:29: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:579:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def315]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'make_runtime_spec_schema_config_solaris'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def316]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c: scope_hint: In function 'make_runtime_spec_schema_config_solaris'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def317]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_vm_hypervisor(get_val(tree, "hypervisor", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def318]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c: scope_hint: In function 'make_runtime_spec_schema_config_vm'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_vm_kernel(get_val(tree, "kernel", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c: scope_hint: In function 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_linux_syscall_arg(val,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def320]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c: scope_hint: In function 'runtime_spec_schema_features_schema_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:150:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:41:25: note: in expansion of macro 'YAJL_GET_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:162:29: note: in expansion of macro 'YAJL_IS_STRING'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: note: in expansion of macro 'YAJL_GET_STRING'
#  148|   
#  149|   /* Various convenience macros to check the type of a `yajl_val` */
#  150|-> #define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))
#  151|   #define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def321]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'image_spec_schema_image_manifest_schema_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:426:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def322]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'basic_test_double_array_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:142:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:142:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def323]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c: scope_hint: In function 'make_image_spec_schema_config_schema'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_config(get_val(tree, "config", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:42:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:42:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def324]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c: scope_hint: In function 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_manifest_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def325]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:214:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:214:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c: scope_hint: In function 'make_runtime_spec_schema_config_schema'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:27:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:27:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def327]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1263:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1263:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:155:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1003:28: note: in expansion of macro 'YAJL_GET_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2613:29: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:180:29: note: in expansion of macro 'YAJL_IS_ARRAY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1003:28: note: in expansion of macro 'YAJL_GET_ARRAY'
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|-> #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def329]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_double_array_item_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:261:1: note: in expansion of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_file_stream'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c: scope_hint: In function 'basic_test_double_array_item_parse_data'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def331]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c: scope_hint: In function 'make_basic_test_double_array'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_double_array.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c: scope_hint: In function 'make_basic_test_top_double_array_obj_container'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_obj_element(*<unknown>,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/basic_test_top_double_array_obj.c:29:26: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def333]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_config(get_val(tree, "config", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:8: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c: scope_hint: In function 'make_runtime_spec_schema_features_linux'
crun-1.18.2-build/crun-1.18.2/libocispec/src/yajl/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:29:23: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:29:23: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:48:23: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:67:28: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:86:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:105:25: note: in expansion of macro 'YAJL_IS_TRUE'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:29:23: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

Error: CPPCHECK_WARNING (CWE-457): [#def336]
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-775): [#def337]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function 'libcrun_precreate_cgroup_cgroupfs'
crun-1.18.2-build/crun-1.18.2/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): [#def338]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-cgroupfs.c: scope_hint: In function ‘libcrun_precreate_cgroup_cgroupfs’
crun-1.18.2-build/crun-1.18.2/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-688): [#def339]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:152:12: warning[-Wanalyzer-null-argument]: use of NULL 'controllers' where non-null expected
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:314:16: note: in expansion of macro 'crun_make_error'
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
#  150|         key = xstrdup (name);
#  151|   
#  152|->       it = strchr (key, '.');
#  153|         if (it == NULL)
#  154|           {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def340]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:152:12: warning[-Wanalyzer-null-argument]: use of NULL ‘controllers’ where non-null expected
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:314:16: note: in expansion of macro ‘crun_make_error’
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
#  150|         key = xstrdup (name);
#  151|   
#  152|->       it = strchr (key, '.');
#  153|         if (it == NULL)
#  154|           {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def341]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function 'update_cgroup_v2_resources'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:1300:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 589824)'
# 1298|       return ret;
# 1299|   
# 1300|->   cgroup_dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 1301|     if (UNLIKELY (cgroup_dirfd < 0))
# 1302|       return crun_make_error (err, errno, "open `%s`", cgroup_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def342]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function ‘update_cgroup_v2_resources’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:1300:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(cgroup_path, 589824)’
# 1298|       return ret;
# 1299|   
# 1300|->   cgroup_dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 1301|     if (UNLIKELY (cgroup_dirfd < 0))
# 1302|       return crun_make_error (err, errno, "open `%s`", cgroup_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def343]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function 'initialize_cpuset_subsystem_rec'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:53:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 2686976)'
#   51|     int b_len;
#   52|   
#   53|->   dirfd = open (path, O_DIRECTORY | O_PATH | O_CLOEXEC);
#   54|     if (UNLIKELY (dirfd < 0))
#   55|       return crun_make_error (err, errno, "open `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def344]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem_rec’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:53:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 2686976)’
#   51|     int b_len;
#   52|   
#   53|->   dirfd = open (path, O_DIRECTORY | O_PATH | O_CLOEXEC);
#   54|     if (UNLIKELY (dirfd < 0))
#   55|       return crun_make_error (err, errno, "open `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def345]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function ‘initialize_cpuset_subsystem’
crun-1.18.2-build/crun-1.18.2/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): [#def346]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL 'cgroup_crun_exec_path' where non-null expected
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def347]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function ‘enter_cgroup_v2’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL ‘cgroup_crun_exec_path’ where non-null expected
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:309:12: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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-401): [#def348]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:490:1: warning[-Wanalyzer-malloc-leak]: leak of 'cgroup_crun_exec_path'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  488|       }
#  489|     return ret;
#  490|-> }
#  491|   
#  492|   int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c: scope_hint: In function ‘enter_cgroup_v2’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:490:1: warning[-Wanalyzer-malloc-leak]: leak of ‘cgroup_crun_exec_path’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  488|       }
#  489|     return ret;
#  490|-> }
#  491|   
#  492|   int

Error: GCC_ANALYZER_WARNING (CWE-775): [#def350]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c:968:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_to_cgroup, 2818048)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'libcrun_get_cgroup_dirfd'
#  966|       return ret;
#  967|   
#  968|->   cgroupdirfd = open (path_to_cgroup, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_PATH);
#  969|     if (UNLIKELY (cgroupdirfd < 0))
#  970|       return crun_make_error (err, errno, "open `%s`", path_to_cgroup);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def351]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘libcrun_get_cgroup_dirfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c:968:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path_to_cgroup, 2818048)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘libcrun_get_cgroup_dirfd’
#  966|       return ret;
#  967|   
#  968|->   cgroupdirfd = open (path_to_cgroup, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_PATH);
#  969|     if (UNLIKELY (cgroupdirfd < 0))
#  970|       return crun_make_error (err, errno, "open `%s`", path_to_cgroup);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def352]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_destroy'
crun-1.18.2-build/crun-1.18.2/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): [#def353]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_destroy’
crun-1.18.2-build/crun-1.18.2/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): [#def354]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_update_cgroup_resources'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:220:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  218|       return ret;
#  219|   
#  220|->   if (cgroup_manager->update_resources)
#  221|       {
#  222|         ret = cgroup_manager->update_resources (cgroup_status, state_root, resources, err);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def355]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_update_cgroup_resources’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:220:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
#  218|       return ret;
#  219|   
#  220|->   if (cgroup_manager->update_resources)
#  221|       {
#  222|         ret = cgroup_manager->update_resources (cgroup_status, state_root, resources, err);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def356]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_preenter'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:278:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  276|       return ret;
#  277|   
#  278|->   if (cgroup_manager->precreate_cgroup == NULL)
#  279|       return 0;
#  280|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def357]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_preenter’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:278:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
#  276|       return ret;
#  277|   
#  278|->   if (cgroup_manager->precreate_cgroup == NULL)
#  279|       return 0;
#  280|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def358]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_enter'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:335:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  333|     status->manager = args->manager;
#  334|   
#  335|->   ret = cgroup_manager->create_cgroup (args, status, err);
#  336|     if (UNLIKELY (ret < 0))
#  337|       {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def359]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c: scope_hint: In function ‘libcrun_cgroup_enter’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:335:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cgroup_manager’
#  333|     status->manager = args->manager;
#  334|   
#  335|->   ret = cgroup_manager->create_cgroup (args, status, err);
#  336|     if (UNLIKELY (ret < 0))
#  337|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def360]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c: scope_hint: In function 'fetchve'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of 'read_file("/proc/self/cmdline", &cmdline_size)'
crun-1.18.2-build/crun-1.18.2/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): [#def361]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c: scope_hint: In function ‘fetchve’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c:190:40: warning[-Wanalyzer-malloc-leak]: leak of ‘read_file("/proc/self/cmdline", &cmdline_size)’
crun-1.18.2-build/crun-1.18.2/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-476): [#def362]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c: scope_hint: In function 'parse_xargs'
crun-1.18.2-build/crun-1.18.2/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): [#def363]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cloned_binary.c: scope_hint: In function ‘parse_xargs’
crun-1.18.2-build/crun-1.18.2/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-401): [#def364]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_load_from_file'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:554:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  552|       container->config_file_content = xstrdup (config);
#  553|   
#  554|->   return container;
#  555|   }
#  556|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def365]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_load_from_file’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:554:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#  552|       container->config_file_content = xstrdup (config);
#  553|   
#  554|->   return container;
#  555|   }
#  556|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def366]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'container_delete_internal'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1736:15: warning[-Wanalyzer-null-dereference]: dereference of NULL 'container'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:580:7: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1617:12: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro 'crun_make_error'
# 1734|               return ret;
# 1735|   
# 1736|->           def = container->container_def;
# 1737|           }
# 1738|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def367]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘container_delete_internal’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1736:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘container’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:580:7: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1617:12: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro ‘crun_make_error’
# 1734|               return ret;
# 1735|   
# 1736|->           def = container->container_def;
# 1737|           }
# 1738|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def368]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'exec_process_entrypoint'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3496:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
# 3494|   
# 3495|     TEMP_FAILURE_RETRY (write (pipefd1, "0", 1));
# 3496|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 3497|     pipefd1 = -1;
# 3498|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def369]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘exec_process_entrypoint’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3496:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
# 3494|   
# 3495|     TEMP_FAILURE_RETRY (write (pipefd1, "0", 1));
# 3496|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 3497|     pipefd1 = -1;
# 3498|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def370]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3665:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'process'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3663|   
# 3664|     /* This must be done before we enter a user namespace.  */
# 3665|->   ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3666|     if (UNLIKELY (ret < 0))
# 3667|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def371]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3665:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘process’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3663|   
# 3664|     /* This must be done before we enter a user namespace.  */
# 3665|->   ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3666|     if (UNLIKELY (ret < 0))
# 3667|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def372]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3680:32: warning[-Wanalyzer-malloc-leak]: leak of '*process.selinux_label'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3678|       {
# 3679|         if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 3680|->         process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 3681|   
# 3682|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def373]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3680:32: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.selinux_label’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3678|       {
# 3679|         if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 3680|->         process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 3681|   
# 3682|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def374]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3683:35: warning[-Wanalyzer-malloc-leak]: leak of '*process.apparmor_profile'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3681|   
# 3682|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 3683|->         process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 3684|   
# 3685|         if (process->user == NULL && container->container_def->process->user)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def375]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3683:35: warning[-Wanalyzer-malloc-leak]: leak of ‘*process.apparmor_profile’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3681|   
# 3682|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 3683|->         process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 3684|   
# 3685|         if (process->user == NULL && container->container_def->process->user)

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def376]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3709:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3707|     if (pid == 0)
# 3708|       {
# 3709|->       TEMP_FAILURE_RETRY (close (pipefd0));
# 3710|         pipefd0 = -1;
# 3711|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def377]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3709:27: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3707|     if (pid == 0)
# 3708|       {
# 3709|->       TEMP_FAILURE_RETRY (close (pipefd0));
# 3710|         pipefd0 = -1;
# 3711|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def378]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3720:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3718|       }
# 3719|   
# 3720|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 3721|     pipefd1 = -1;
# 3722|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def379]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:3720:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
# 3718|       }
# 3719|   
# 3720|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 3721|     pipefd1 = -1;
# 3722|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def380]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function 'restore_cgroup_v1_mount'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:298:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  296|         subsystem = strchr (from, ':') + 1;
#  297|         subpath = strchr (subsystem, ':') + 1;
#  298|->       *(subpath - 1) = '\0';
#  299|   
#  300|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def381]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function ‘restore_cgroup_v1_mount’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:298:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  296|         subsystem = strchr (from, ':') + 1;
#  297|         subpath = strchr (subsystem, ':') + 1;
#  298|->       *(subpath - 1) = '\0';
#  299|   
#  300|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def382]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:300:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  298|         *(subpath - 1) = '\0';
#  299|   
#  300|->       if (subsystem[0] == '\0')
#  301|           continue;
#  302|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def383]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:300:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  298|         *(subpath - 1) = '\0';
#  299|   
#  300|->       if (subsystem[0] == '\0')
#  301|           continue;
#  302|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def384]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function 'checkpoint_cgroup_v1_mount'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:365:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  363|         subsystem = strchr (from, ':') + 1;
#  364|         subpath = strchr (subsystem, ':') + 1;
#  365|->       *(subpath - 1) = '\0';
#  366|   
#  367|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def385]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function ‘checkpoint_cgroup_v1_mount’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:365:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  363|         subsystem = strchr (from, ':') + 1;
#  364|         subpath = strchr (subsystem, ':') + 1;
#  365|->       *(subpath - 1) = '\0';
#  366|   
#  367|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def386]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:367:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  365|         *(subpath - 1) = '\0';
#  366|   
#  367|->       if (subsystem[0] == '\0')
#  368|           continue;
#  369|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def387]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:367:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  365|         *(subpath - 1) = '\0';
#  366|   
#  367|->       if (subsystem[0] == '\0')
#  368|           continue;
#  369|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def388]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_checkpoint_linux_criu'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:442:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  440|       return crun_make_error (err, errno, "error creating checkpoint directory `%s`", cr_options->image_path);
#  441|   
#  442|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  443|     if (UNLIKELY (image_fd == -1))
#  444|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def389]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_checkpoint_linux_criu’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:442:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  440|       return crun_make_error (err, errno, "error creating checkpoint directory `%s`", cr_options->image_path);
#  441|   
#  442|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  443|     if (UNLIKELY (image_fd == -1))
#  444|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:462:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  460|     if (cr_options->work_path != NULL)
#  461|       {
#  462|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  463|         if (UNLIKELY (work_fd == -1))
#  464|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def391]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:462:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  460|     if (cr_options->work_path != NULL)
#  461|       {
#  462|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  463|         if (UNLIKELY (work_fd == -1))
#  464|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def392]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function 'prepare_restore_mounts'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:707:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(root, 524288)'
#  705|           }
#  706|   
#  707|->       root_fd = open (root, O_RDONLY | O_CLOEXEC);
#  708|         if (UNLIKELY (root_fd == -1))
#  709|           return crun_make_error (err, errno, "error opening container root directory `%s`", root);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def393]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function ‘prepare_restore_mounts’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:707:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(root, 524288)’
#  705|           }
#  706|   
#  707|->       root_fd = open (root, O_RDONLY | O_CLOEXEC);
#  708|         if (UNLIKELY (root_fd == -1))
#  709|           return crun_make_error (err, errno, "error opening container root directory `%s`", root);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def394]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function 'libcrun_container_restore_linux_criu'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:765:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#  763|       return crun_make_error (err, 0, "image path not set");
#  764|   
#  765|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  766|     if (UNLIKELY (image_fd == -1))
#  767|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def395]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c: scope_hint: In function ‘libcrun_container_restore_linux_criu’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:765:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.image_path, 589824)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#  763|       return crun_make_error (err, 0, "image path not set");
#  764|   
#  765|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  766|     if (UNLIKELY (image_fd == -1))
#  767|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def396]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:821:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro 'YAJL_IS_ARRAY'
#  819|     if (cr_options->work_path != NULL)
#  820|       {
#  821|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  822|         if (UNLIKELY (work_fd == -1))
#  823|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def397]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:821:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(*cr_options.work_path, 589824)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro ‘YAJL_IS_ARRAY’
#  819|     if (cr_options->work_path != NULL)
#  820|       {
#  821|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  822|         if (UNLIKELY (work_fd == -1))
#  823|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def398]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:924:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_148.path, 0)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro 'YAJL_IS_ARRAY'
#  922|         if (value == CLONE_NEWNET && def->linux->namespaces[i]->path != NULL)
#  923|           {
#  924|->           inherit_new_net_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  925|             if (UNLIKELY (inherit_new_net_fd < 0))
#  926|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def399]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:924:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_148.path, 0)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro ‘YAJL_IS_ARRAY’
#  922|         if (value == CLONE_NEWNET && def->linux->namespaces[i]->path != NULL)
#  923|           {
#  924|->           inherit_new_net_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  925|             if (UNLIKELY (inherit_new_net_fd < 0))
#  926|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def400]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:933:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_165.path, 0)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro 'YAJL_IS_ARRAY'
#  931|         if (value == CLONE_NEWPID && def->linux->namespaces[i]->path != NULL)
#  932|           {
#  933|->           inherit_new_pid_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  934|             if (UNLIKELY (inherit_new_pid_fd < 0))
#  935|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def401]
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:933:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(**_165.path, 0)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro ‘YAJL_IS_ARRAY’
#  931|         if (value == CLONE_NEWPID && def->linux->namespaces[i]->path != NULL)
#  932|           {
#  933|->           inherit_new_pid_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  934|             if (UNLIKELY (inherit_new_pid_fd < 0))
#  935|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def402]
crun-1.18.2-build/crun-1.18.2/src/libcrun/ebpf.c: scope_hint: In function ‘read_all_progs’
crun-1.18.2-build/crun-1.18.2/src/libcrun/ebpf.c:294:18: warning[-Wanalyzer-infinite-loop]: infinite loop
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-457): [#def403]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c: scope_hint: In function 'log_write_to_syslog'
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:308:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'priority'
#  306|       }
#  307|     if (errno_ == 0)
#  308|->     syslog (priority, "%s", msg);
#  309|     else
#  310|       syslog (priority, "%s: %s", msg, strerror (errno_));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def404]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c: scope_hint: In function ‘log_write_to_syslog’
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:308:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘priority’
#  306|       }
#  307|     if (errno_ == 0)
#  308|->     syslog (priority, "%s", msg);
#  309|     else
#  310|       syslog (priority, "%s: %s", msg, strerror (errno_));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def405]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:310:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'priority'
#  308|       syslog (priority, "%s", msg);
#  309|     else
#  310|->     syslog (priority, "%s: %s", msg, strerror (errno_));
#  311|   }
#  312|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def406]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:310:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘priority’
#  308|       syslog (priority, "%s", msg);
#  309|     else
#  310|->     syslog (priority, "%s: %s", msg, strerror (errno_));
#  311|   }
#  312|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def407]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c: scope_hint: In function 'make_json_error'
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:407:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'level'
#  405|   
#  406|     yajl_gen_string (gen, YAJL_STR ("level"), strlen ("level"));
#  407|->   yajl_gen_string (gen, YAJL_STR (level), strlen (level));
#  408|   
#  409|     yajl_gen_string (gen, YAJL_STR ("time"), strlen ("time"));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def408]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c: scope_hint: In function ‘make_json_error’
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.c:407:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘level’
#  405|   
#  406|     yajl_gen_string (gen, YAJL_STR ("level"), strlen ("level"));
#  407|->   yajl_gen_string (gen, YAJL_STR (level), strlen (level));
#  408|   
#  409|     yajl_gen_string (gen, YAJL_STR ("time"), strlen ("time"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def409]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container'
crun-1.18.2-build/crun-1.18.2/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): [#def410]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’
crun-1.18.2-build/crun-1.18.2/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): [#def411]
crun-1.18.2-build/crun-1.18.2/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): [#def412]
crun-1.18.2-build/crun-1.18.2/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): [#def413]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_container'
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: 'create_sev' may be used uninitialized
#  248 |   if (create_sev)
#      |      ^
crun-1.18.2-build/crun-1.18.2/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): [#def414]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_configure_container’
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c:248:6: warning[-Wmaybe-uninitialized]: ‘create_sev’ may be used uninitialized
#  248 |   if (create_sev)
#      |      ^
crun-1.18.2-build/crun-1.18.2/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-563): [#def415]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_load'
crun-1.18.2-build/crun-1.18.2/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): [#def416]
crun-1.18.2-build/crun-1.18.2/src/libcrun/handlers/krun.c: scope_hint: In function ‘libkrun_load’
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-775): [#def417]
crun-1.18.2-build/crun-1.18.2/src/libcrun/intelrdt.c: scope_hint: In function 'resctl_update'
crun-1.18.2-build/crun-1.18.2/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): [#def418]
crun-1.18.2-build/crun-1.18.2/src/libcrun/intelrdt.c: scope_hint: In function ‘resctl_update’
crun-1.18.2-build/crun-1.18.2/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: CPPCHECK_WARNING (CWE-457): [#def419]
crun-1.18.2-build/crun-1.18.2/src/libcrun/linux.c:3680: error[uninitvar]: Uninitialized variable: code
# 3678|         if (UNLIKELY (ret < 0))
# 3679|           return false;
# 3680|->       *error = code;
# 3681|       }
# 3682|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def420]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-1.18.2-build/crun-1.18.2/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): [#def421]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'libcrun_open_seccomp_bpf'
crun-1.18.2-build/crun-1.18.2/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): [#def422]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘store_seccomp_cache’
crun-1.18.2-build/crun-1.18.2/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): [#def423]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘libcrun_open_seccomp_bpf’
crun-1.18.2-build/crun-1.18.2/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): [#def424]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'open_rundir_dirfd'
crun-1.18.2-build/crun-1.18.2/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): [#def425]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘open_rundir_dirfd’
crun-1.18.2-build/crun-1.18.2/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): [#def426]
crun-1.18.2-build/crun-1.18.2/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): [#def427]
crun-1.18.2-build/crun-1.18.2/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): [#def428]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
crun-1.18.2-build/crun-1.18.2/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): [#def429]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’
crun-1.18.2-build/crun-1.18.2/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-688): [#def430]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL 'entries' where non-null expected
crun-1.18.2-build/crun-1.18.2/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): [#def431]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c:562:7: warning[-Wanalyzer-null-argument]: use of NULL ‘entries’ where non-null expected
crun-1.18.2-build/crun-1.18.2/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-401): [#def432]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:50:12: warning[-Wanalyzer-malloc-leak]: leak of 'get_run_directory(state_root)'
#   48|     if (state_root)
#   49|       root = xstrdup (state_root);
#   50|->   if (root == NULL)
#   51|       {
#   52|         const char *runtime_dir = getenv ("XDG_RUNTIME_DIR");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:50:12: warning[-Wanalyzer-malloc-leak]: leak of ‘get_run_directory(state_root)’
#   48|     if (state_root)
#   49|       root = xstrdup (state_root);
#   50|->   if (root == NULL)
#   51|       {
#   52|         const char *runtime_dir = getenv ("XDG_RUNTIME_DIR");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def434]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'read_pid_stat'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:119:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&pid_stat_file, 524288)'
#  117|     sprintf (pid_stat_file, "/proc/%d/stat", pid);
#  118|   
#  119|->   fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC);
#  120|     if (fd < 0)
#  121|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def435]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘read_pid_stat’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:119:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&pid_stat_file, 524288)’
#  117|     sprintf (pid_stat_file, "/proc/%d/stat", pid);
#  118|   
#  119|->   fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC);
#  120|     if (fd < 0)
#  121|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'rmdirfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:474:7: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(fd)'
#  472|     __attribute__ ((unused)) cleanup_close int fd_cleanup = fd;
#  473|   
#  474|->   d = fdopendir (fd);
#  475|     if (d == NULL)
#  476|       return crun_make_error (err, errno, "cannot open directory `%s`", namedir);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def437]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘rmdirfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:474:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(fd)’
#  472|     __attribute__ ((unused)) cleanup_close int fd_cleanup = fd;
#  473|   
#  474|->   d = fdopendir (fd);
#  475|     if (d == NULL)
#  476|       return crun_make_error (err, errno, "cannot open directory `%s`", namedir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def438]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:536:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(get_run_directory(state_root), 2686976)'
#  534|       return crun_make_error (err, 0, "cannot get state directory");
#  535|   
#  536|->   rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_PATH | O_CLOEXEC));
#  537|     if (UNLIKELY (rundir_dfd < 0))
#  538|       return crun_make_error (err, errno, "cannot open run directory `%s`", dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def439]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:536:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(get_run_directory(state_root), 2686976)’
#  534|       return crun_make_error (err, 0, "cannot get state directory");
#  535|   
#  536|->   rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_PATH | O_CLOEXEC));
#  537|     if (UNLIKELY (rundir_dfd < 0))
#  538|       return crun_make_error (err, errno, "cannot open run directory `%s`", dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def440]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:557:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'rundir_dfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.h:42: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:22: included_from: Included from here.
#  555|   
#  556|     return 0;
#  557|-> }
#  558|   
#  559|   void

Error: GCC_ANALYZER_WARNING (CWE-775): [#def441]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_container_delete_status’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:557:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘rundir_dfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.h:42: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:22: included_from: Included from here.
#  555|   
#  556|     return 0;
#  557|-> }
#  558|   
#  559|   void

Error: GCC_ANALYZER_WARNING (CWE-401): [#def442]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:583:9: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(get_run_directory(state_root))'
#  581|   
#  582|     *ret = NULL;
#  583|->   dir = opendir (path);
#  584|     if (UNLIKELY (dir == NULL))
#  585|       return crun_make_error (err, errno, "cannot opendir `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def443]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:583:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(get_run_directory(state_root))’
#  581|   
#  582|     *ret = NULL;
#  583|->   dir = opendir (path);
#  584|     if (UNLIKELY (dir == NULL))
#  585|       return crun_make_error (err, errno, "cannot opendir `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def444]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:583:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
crun-1.18.2-build/crun-1.18.2/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
#  581|   
#  582|     *ret = NULL;
#  583|->   dir = opendir (path);
#  584|     if (UNLIKELY (dir == NULL))
#  585|       return crun_make_error (err, errno, "cannot opendir `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def445]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'libcrun_status_create_exec_fifo'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:693:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 526336)'
#  691|       return crun_make_error (err, errno, "mkfifo");
#  692|   
#  693|->   fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC);
#  694|     if (UNLIKELY (fd < 0))
#  695|       return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def446]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_create_exec_fifo’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:693:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 526336)’
#  691|       return crun_make_error (err, errno, "mkfifo");
#  692|   
#  693|->   fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC);
#  694|     if (UNLIKELY (fd < 0))
#  695|       return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def447]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'libcrun_status_write_exec_fifo'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:715:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 524289)'
#  713|       return ret;
#  714|   
#  715|->   fd = open (fifo_path, O_WRONLY | O_CLOEXEC);
#  716|     if (UNLIKELY (fd < 0))
#  717|       return crun_make_error (err, errno, "cannot open `%s`", fifo_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def448]
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘libcrun_status_write_exec_fifo’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c:715:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fifo_path, 524289)’
#  713|       return ret;
#  714|   
#  715|->   fd = open (fifo_path, O_WRONLY | O_CLOEXEC);
#  716|     if (UNLIKELY (fd < 0))
#  717|       return crun_make_error (err, errno, "cannot open `%s`", fifo_path);

Error: COMPILER_WARNING (CWE-457): [#def449]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'format_default_id_mapping'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1560:12: warning[-Wmaybe-uninitialized]: 'from' may be used uninitialized
# 1560 |       from += used;
#      |            ^~
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1544:12: note: 'from' was declared here
# 1544 |   uint32_t from, available;
#      |            ^~~~
# 1558|         uint32_t used = MIN (container_id, available);
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|->       from += used;
# 1561|         available -= used;
# 1562|       }

Error: COMPILER_WARNING (CWE-457): [#def450]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘format_default_id_mapping’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1560:12: warning[-Wmaybe-uninitialized]: ‘from’ may be used uninitialized
# 1560 |       from += used;
#      |            ^~
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1544:12: note: ‘from’ was declared here
# 1544 |   uint32_t from, available;
#      |            ^~~~
# 1558|         uint32_t used = MIN (container_id, available);
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|->       from += used;
# 1561|         available -= used;
# 1562|       }

Error: COMPILER_WARNING (CWE-457): [#def451]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1561:17: warning[-Wmaybe-uninitialized]: 'available' may be used uninitialized
# 1561 |       available -= used;
#      |                 ^~
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1544:18: note: 'available' was declared here
# 1544 |   uint32_t from, available;
#      |                  ^~~~~~~~~
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|         from += used;
# 1561|->       available -= used;
# 1562|       }
# 1563|   

Error: COMPILER_WARNING (CWE-457): [#def452]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1561:17: warning[-Wmaybe-uninitialized]: ‘available’ may be used uninitialized
# 1561 |       available -= used;
#      |                 ^~
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:1544:18: note: ‘available’ was declared here
# 1544 |   uint32_t from, available;
#      |                  ^~~~~~~~~
# 1559|         written += sprintf (buffer + written, "%d %d %d\n", 0, from, used);
# 1560|         from += used;
# 1561|->       available -= used;
# 1562|       }
# 1563|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def453]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2085:12: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(srcdirfd)'
# 2083|     struct dirent *de;
# 2084|   
# 2085|->   dsrcfd = fdopendir (srcdirfd);
# 2086|     if (UNLIKELY (dsrcfd == NULL))
# 2087|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def454]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2085:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopendir(srcdirfd)’
# 2083|     struct dirent *de;
# 2084|   
# 2085|->   dsrcfd = fdopendir (srcdirfd);
# 2086|     if (UNLIKELY (dsrcfd == NULL))
# 2087|       {

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def455]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2088:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcdirfd'
# 2086|     if (UNLIKELY (dsrcfd == NULL))
# 2087|       {
# 2088|->       TEMP_FAILURE_RETRY (close (srcdirfd));
# 2089|         return crun_make_error (err, errno, "cannot open directory `%s`", destname);
# 2090|       }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def456]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2088:27: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘srcdirfd’
# 2086|     if (UNLIKELY (dsrcfd == NULL))
# 2087|       {
# 2088|->       TEMP_FAILURE_RETRY (close (srcdirfd));
# 2089|         return crun_make_error (err, errno, "cannot open directory `%s`", destname);
# 2090|       }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def457]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2132:31: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
# 2130|   #endif
# 2131|   
# 2132|->           TEMP_FAILURE_RETRY (close (destfd));
# 2133|             destfd = -1;
# 2134|             break;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def458]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2132:31: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destfd’
# 2130|   #endif
# 2131|   
# 2132|->           TEMP_FAILURE_RETRY (close (destfd));
# 2133|             destfd = -1;
# 2134|             break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def459]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2166: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
# 2164|               return ret;
# 2165|   
# 2166|->           ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2167|             if (UNLIKELY (ret < 0))
# 2168|               return crun_make_error (err, errno, "create symlink `%s/%s`", destname, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def460]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2166: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
# 2164|               return ret;
# 2165|   
# 2166|->           ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2167|             if (UNLIKELY (ret < 0))
# 2168|               return crun_make_error (err, errno, "create symlink `%s/%s`", destname, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def461]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'read_file_as_long_or_default'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2491: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.18.2-build/crun-1.18.2/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
# 2489|   
# 2490|     errno = 0;
# 2491|->   val = strtol (content, &endptr, 10);
# 2492|     if (UNLIKELY (errno))
# 2493|       return def_value;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def462]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘read_file_as_long_or_default’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:2491: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.18.2-build/crun-1.18.2/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
# 2489|   
# 2490|     errno = 0;
# 2491|->   val = strtol (content, &endptr, 10);
# 2492|     if (UNLIKELY (errno))
# 2493|       return def_value;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def463]
crun-1.18.2-build/crun-1.18.2/src/libcrun/intelrdt.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'resctl_update'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'intelrdt_clean_l3_cache_schema(l3_cache_schema)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def464]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'safe_read_xattr'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(current_size + 1))'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def465]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'copy_xattr'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(xattr_len + 1))'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def466]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp_notify.c:32: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_load_seccomp_notify_plugins'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def467]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def468]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((n_parts_a + 1) * 8)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def469]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_dir_entries'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(128)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def470]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(16)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def471]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_all_fd_with_size_hint'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(allocated + 1)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'read_all_fd_with_size_hint'
crun-1.18.2-build/crun-1.18.2/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): [#def472]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'write_controller_file'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(controllers_len + 1)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def473]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'copy_from_fd_to_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(get_page_size())'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def474]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c:25: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_copy_seccomp'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(in_size + 1)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def475]
crun-1.18.2-build/crun-1.18.2/src/libcrun/intelrdt.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘resctl_update’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘intelrdt_clean_l3_cache_schema(l3_cache_schema)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def476]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘safe_read_xattr’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(current_size + 1))’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def477]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘copy_xattr’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)(xattr_len + 1))’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def478]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp_notify.c:32: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_load_seccomp_notify_plugins’
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def479]
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def480]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((n_parts_a + 1) * 8)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def481]
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_utils.c:20: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘test_write_read_file’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(1024)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def482]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_dir_entries’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(128)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def483]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(16)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def484]
crun-1.18.2-build/crun-1.18.2/src/exec.c:29: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(88)’
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:29: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def485]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_all_fd_with_size_hint’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(allocated + 1)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘read_all_fd_with_size_hint’
crun-1.18.2-build/crun-1.18.2/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): [#def486]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘write_controller_file’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(controllers_len + 1)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def487]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘copy_from_fd_to_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(get_page_size())’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def488]
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c:25: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_copy_seccomp’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:62:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(in_size + 1)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def489]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file("config.json", err)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def490]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update_intel_rdt'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file(config_file,  err)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def491]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_load_from_file'
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def492]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0((num_mount_options + 1) * 8)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def493]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(120)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/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): [#def494]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(144)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def495]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_update'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(176)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/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): [#def496]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_cgroup_enter'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(24)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def497]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(48)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def498]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file("config.json", err)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def499]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update_intel_rdt’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘libcrun_container_load_from_file(config_file,  err)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def500]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_load_from_file’
crun-1.18.2-build/crun-1.18.2/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.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def501]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘make_oci_process_user(exec_options.user)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def502]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)(argc + 1) * 8)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def503]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((num_mount_options + 1) * 8)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def504]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(120)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/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): [#def505]
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(144)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def506]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_update’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(176)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c:1609:12: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/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): [#def507]
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.c:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_cgroup_enter’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(24)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def508]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(48)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def509]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘make_oci_process_user’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(56)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def510]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'safe_read_xattr'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(buffer, (long unsigned int)(current_size + 1))'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def511]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries,  entries_size * 16)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def512]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_dir_entries'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 8)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def513]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'evict_cache'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 88)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def514]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_ebpf_load'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(log,  log_size)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def515]
crun-1.18.2-build/crun-1.18.2/src/libcrun/ebpf.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_all_progs'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(progs,  cur_size * 4)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def516]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'safe_readlinkat'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def517]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘safe_read_xattr’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(buffer, (long unsigned int)(current_size + 1))’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def518]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(entries,  entries_size * 16)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def519]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_dir_entries’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(entries, (n_entries + 1) * 8)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def520]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘evict_cache’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(entries, (n_entries + 1) * 88)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def521]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_ebpf_load’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(log,  log_size)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def522]
crun-1.18.2-build/crun-1.18.2/src/libcrun/ebpf.c:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_all_progs’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(progs,  cur_size * 4)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def523]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘safe_readlinkat’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:80:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xrealloc(tmp_buf, (long unsigned int)(buf_size + 1))’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def524]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&cgroup_path_type'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def525]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&content'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function 'maybe_make_cgroup_threaded'
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def526]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&controllers'
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:1020:16: note: in expansion of macro 'crun_make_error'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper'
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def527]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&target_buf'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def528]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'buffer'
crun-1.18.2-build/crun-1.18.2/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): [#def529]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'entries'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
crun-1.18.2-build/crun-1.18.2/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): [#def530]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'log'
crun-1.18.2-build/crun-1.18.2/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): [#def531]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'progs'
crun-1.18.2-build/crun-1.18.2/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): [#def532]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-'free' of 'tmp_buf'
crun-1.18.2-build/crun-1.18.2/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): [#def533]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(void **)&cgroup_path_type’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def534]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(void **)&content’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-utils.c: scope_hint: In function ‘maybe_make_cgroup_threaded’
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def535]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(void **)&controllers’
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c:1020:16: note: in expansion of macro ‘crun_make_error’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-resources.c: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def536]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(void **)&target_buf’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘copy_recursive_fd_to_fd’
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def537]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘buffer’
crun-1.18.2-build/crun-1.18.2/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): [#def538]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘bundle_cleanup’
crun-1.18.2-build/crun-1.18.2/src/restore.c: scope_hint: In function ‘crun_command_restore’
#   87|   {
#   88|     void **pp = (void **) p;
#   89|->   free (*pp);
#   90|   }
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def539]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘entries’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘evict_cache’
crun-1.18.2-build/crun-1.18.2/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): [#def540]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘log’
crun-1.18.2-build/crun-1.18.2/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): [#def541]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘progs’
crun-1.18.2-build/crun-1.18.2/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): [#def542]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘tmp_buf’
crun-1.18.2-build/crun-1.18.2/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): [#def543]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.18.2-build/crun-1.18.2/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): [#def544]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:89:3: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
crun-1.18.2-build/crun-1.18.2/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-1341): [#def545]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.h:42: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/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): [#def546]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/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): [#def547]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'console_socket_fd'
crun-1.18.2-build/crun-1.18.2/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): [#def548]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destdirfd'
crun-1.18.2-build/crun-1.18.2/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): [#def549]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/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): [#def550]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-1.18.2-build/crun-1.18.2/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): [#def551]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd_cleanup'
crun-1.18.2-build/crun-1.18.2/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): [#def552]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'image_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/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): [#def553]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def554]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'root_fd'
crun-1.18.2-build/crun-1.18.2/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): [#def555]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rootfsfd_cleanup'
crun-1.18.2-build/crun-1.18.2/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): [#def556]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'signalfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/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): [#def557]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcfd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-1.18.2-build/crun-1.18.2/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): [#def558]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'wfd'
crun-1.18.2-build/crun-1.18.2/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): [#def559]
crun-1.18.2-build/crun-1.18.2/src/libcrun/error.h:42: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup.h:21: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/cgroup-setup.c:22: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/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): [#def560]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘cfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/status.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/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): [#def561]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘console_socket_fd’
crun-1.18.2-build/crun-1.18.2/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): [#def562]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘destdirfd’
crun-1.18.2-build/crun-1.18.2/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): [#def563]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘dirfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/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): [#def564]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd_cleanup’
crun-1.18.2-build/crun-1.18.2/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): [#def565]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’
crun-1.18.2-build/crun-1.18.2/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): [#def566]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘image_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/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): [#def567]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/seccomp.h:24: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/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): [#def568]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘outfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/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): [#def569]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/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): [#def570]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd1’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:39:32: note: in definition of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:5: note: in expansion of macro ‘TEMP_FAILURE_RETRY’
crun-1.18.2-build/crun-1.18.2/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): [#def571]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘root_fd’
crun-1.18.2-build/crun-1.18.2/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): [#def572]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘rootfsfd_cleanup’
crun-1.18.2-build/crun-1.18.2/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): [#def573]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘signalfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/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): [#def574]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘srcfd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.c: scope_hint: In function ‘cleanup_closep.part.0’
crun-1.18.2-build/crun-1.18.2/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): [#def575]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:105:25: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘wfd’
crun-1.18.2-build/crun-1.18.2/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): [#def576]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_set_stdio'
crun-1.18.2-build/crun-1.18.2/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): [#def577]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_set_stdio’
crun-1.18.2-build/crun-1.18.2/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): [#def578]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.18.2-build/crun-1.18.2/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): [#def579]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'own_seccomp_receiver_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.18.2-build/crun-1.18.2/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): [#def580]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.18.2-build/crun-1.18.2/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): [#def581]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
crun-1.18.2-build/crun-1.18.2/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): [#def582]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'terminal_fd'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'close_and_reset'
crun-1.18.2-build/crun-1.18.2/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): [#def583]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘memfd’
crun-1.18.2-build/crun-1.18.2/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): [#def584]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘own_seccomp_receiver_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.18.2-build/crun-1.18.2/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): [#def585]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘seccomp_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.18.2-build/crun-1.18.2/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): [#def586]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘close_and_reset’
crun-1.18.2-build/crun-1.18.2/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): [#def587]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:207:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘terminal_fd’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘close_and_reset’
crun-1.18.2-build/crun-1.18.2/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): [#def588]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features'
crun-1.18.2-build/crun-1.18.2/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): [#def589]
crun-1.18.2-build/crun-1.18.2/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): [#def590]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_dir_entries'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&*<unknown>.d_name)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def591]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_get_containers_list'
crun-1.18.2-build/crun-1.18.2/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): [#def592]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_new_terminal'
crun-1.18.2-build/crun-1.18.2/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): [#def593]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'retrieve_mount_options'
crun-1.18.2-build/crun-1.18.2/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): [#def594]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_70->process.selinux_label)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/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): [#def595]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_75->process.apparmor_profile)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-1.18.2-build/crun-1.18.2/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): [#def596]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_restore_linux_criu'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*status.bundle)'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:32: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro 'YAJL_IS_ARRAY'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'compare_rdt_configurations'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(a)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def598]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(b)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'read_unified_cgroup_pid'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(from)'
crun-1.18.2-build/crun-1.18.2/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): [#def600]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'check_cgroup_v2_controller_available_wrapper'
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(name)'
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
crun-1.18.2-build/crun-1.18.2/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): [#def602]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function 'maybe_make_cgroup_threaded'
crun-1.18.2-build/crun-1.18.2/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): [#def603]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’
crun-1.18.2-build/crun-1.18.2/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): [#def604]
crun-1.18.2-build/crun-1.18.2/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): [#def605]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_dir_entries’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(&*<unknown>.d_name)’
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_get_containers_list’
crun-1.18.2-build/crun-1.18.2/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): [#def607]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_new_terminal’
crun-1.18.2-build/crun-1.18.2/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): [#def608]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘crun_command_exec’
crun-1.18.2-build/crun-1.18.2/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): [#def609]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘retrieve_mount_options’
crun-1.18.2-build/crun-1.18.2/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): [#def610]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_70->process.selinux_label)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/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): [#def611]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*_75->process.apparmor_profile)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.c: scope_hint: In function ‘libcrun_container_exec_with_options’
crun-1.18.2-build/crun-1.18.2/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): [#def612]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_restore_linux_criu’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*status.bundle)’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/container.h:23: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:32: included_from: Included from here.
crun-1.18.2-build/crun-1.18.2/src/libcrun/criu.c:796:17: note: in expansion of macro ‘YAJL_IS_ARRAY’
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘compare_rdt_configurations’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(a)’
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(b)’
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def615]
crun-1.18.2-build/crun-1.18.2/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): [#def616]
crun-1.18.2-build/crun-1.18.2/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): [#def617]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘read_unified_cgroup_pid’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(from)’
crun-1.18.2-build/crun-1.18.2/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): [#def618]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘check_cgroup_v2_controller_available_wrapper’
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h:222:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(name)’
#  220|   
#  221|     ret = strdup (str);
#  222|->   if (ret == NULL)
#  223|       OOM ();
#  224|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def619]
crun-1.18.2-build/crun-1.18.2/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): [#def620]
crun-1.18.2-build/crun-1.18.2/src/libcrun/utils.h: scope_hint: In function ‘maybe_make_cgroup_threaded’
crun-1.18.2-build/crun-1.18.2/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-775): [#def621]
crun-1.18.2-build/crun-1.18.2/src/spec.c: scope_hint: In function ‘crun_command_spec’
crun-1.18.2-build/crun-1.18.2/src/spec.c:126:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(where, "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): [#def622]
crun-1.18.2-build/crun-1.18.2/src/spec.c:126:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(where, "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-775): [#def623]
crun-1.18.2-build/crun-1.18.2/tests/init.c: scope_hint: In function ‘write_to’
crun-1.18.2-build/crun-1.18.2/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): [#def624]
crun-1.18.2-build/crun-1.18.2/tests/init.c: scope_hint: In function ‘check_idmapped_mounts’
crun-1.18.2-build/crun-1.18.2/tests/init.c:209:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&proc_path, 0)’
crun-1.18.2-build/crun-1.18.2/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): [#def625]
crun-1.18.2-build/crun-1.18.2/tests/init.c: scope_hint: In function ‘cat’
crun-1.18.2-build/crun-1.18.2/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): [#def626]
crun-1.18.2-build/crun-1.18.2/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: [#def627]
crun-1.18.2-build/crun-1.18.2/tests/init.c: scope_hint: In function ‘main’
crun-1.18.2-build/crun-1.18.2/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): [#def628]
crun-1.18.2-build/crun-1.18.2/tests/init.c: scope_hint: In function ‘main’
crun-1.18.2-build/crun-1.18.2/tests/init.c:627:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 1)’
#  625|           error (EXIT_FAILURE, errno, "open `%s`", path);
#  626|         ret = write (fd, "1", 1);
#  627|->       if (ret < 0)
#  628|           error (EXIT_FAILURE, errno, "open `%s`", path);
#  629|         close (fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def629]
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘test_generate_ebpf’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c:105:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
crun-1.18.2-build/crun-1.18.2/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: GCC_ANALYZER_WARNING (CWE-775): [#def630]
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘generate_seccomp’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c:164:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
crun-1.18.2-build/crun-1.18.2/tests/tests_libcrun_fuzzer.c: scope_hint: In function ‘generate_seccomp’
#  162|       }
#  163|   
#  164|->   outfd = open ("/dev/null", O_WRONLY);
#  165|     if (outfd < 0)
#  166|       return 0;

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-56.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namecrun-1.18.2-1.fc42
store-results-to/tmp/tmpvg03j16k/crun-1.18.2-1.fc42.tar.xz
time-created2024-11-12 23:27:17
time-finished2024-11-12 23:33:39
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpvg03j16k/crun-1.18.2-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpvg03j16k/crun-1.18.2-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9