crun-1.26-1.20260310140555736157.main.138.gd268d537

List of Findings

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def4]
crun-HEAD/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: CPPCHECK_WARNING (CWE-401): [#def5]
crun-HEAD/libocispec/src/ocispec/basic_test_double_array_item.c:212: error[memleak]: Memory leak: ret
#  210|           ret->item1 = strdup (src->item1);
#  211|           if (ret->item1 == NULL)
#  212|->           return NULL;
#  213|         }
#  214|       ret->item2 = src->item2;

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def10]
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_obj.c:157: error[memleak]: Memory leak: ret
#  155|           ret->third = strdup (src->third);
#  156|           if (ret->third == NULL)
#  157|->           return NULL;
#  158|         }
#  159|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def11]
crun-HEAD/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): [#def12]
crun-HEAD/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|       for (i = 0; i < alen; i++)
#  188|         {

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

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def15]
crun-HEAD/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-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:66:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:8: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0'
#   64|         {
#   65|           size_t j;
#   66|->         for (j = 0; j < ptr->subitem_lens[i]; j++)
#   67|             {
#   68|               free_basic_test_double_array_item (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:68:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_refobj.c: scope_hint: In function 'free_basic_test_top_double_array_refobj_container.part.0'
#   66|           for (j = 0; j < ptr->subitem_lens[i]; j++)
#   67|             {
#   68|->             free_basic_test_double_array_item (ptr->items[i][j]);
#   69|               ptr->items[i][j] = NULL;
#   70|             }

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

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
crun-HEAD/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-HEAD/libocispec/src/ocispec/basic_test_top_double_array_string.c:71:42: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
/usr/include/alloca.h:24: included_from: Included from here.
/usr/include/stdlib.h:728: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:4: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_string.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_string.c:8: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/basic_test_top_double_array_string.c: scope_hint: In function 'free_basic_test_top_double_array_string_container.part.0'
#   69|         {
#   70|           size_t j;
#   71|->         for (j = 0; j < ptr->subitem_lens[i]; j++)
#   72|             {
#   73|               free (ptr->items[i][j]);

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

Error: CPPCHECK_WARNING (CWE-401): [#def21]
crun-HEAD/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): [#def22]
crun-HEAD/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): [#def23]
crun-HEAD/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:319: error[memleak]: Memory leak: ptr
#  317|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#  318|       if (ptr->items == NULL)
#  319|->       return NULL;
#  320|       ptr->len = alen;
#  321|       for (i = 0; i < alen; i++)

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def29]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1020: error[memleak]: Memory leak: ret
# 1018|           ret->created = strdup (src->created);
# 1019|           if (ret->created == NULL)
# 1020|->           return NULL;
# 1021|         }
# 1022|       if (src->author != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def30]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1026: error[memleak]: Memory leak: ret
# 1024|           ret->author = strdup (src->author);
# 1025|           if (ret->author == NULL)
# 1026|->           return NULL;
# 1027|         }
# 1028|       if (src->created_by != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def31]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1032: error[memleak]: Memory leak: ret
# 1030|           ret->created_by = strdup (src->created_by);
# 1031|           if (ret->created_by == NULL)
# 1032|->           return NULL;
# 1033|         }
# 1034|       if (src->comment != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def32]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1038: error[memleak]: Memory leak: ret
# 1036|           ret->comment = strdup (src->comment);
# 1037|           if (ret->comment == NULL)
# 1038|->           return NULL;
# 1039|         }
# 1040|       ret->empty_layer = src->empty_layer;

Error: CPPCHECK_WARNING (CWE-401): [#def33]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1495: error[memleak]: Memory leak: ret
# 1493|           ret->created = strdup (src->created);
# 1494|           if (ret->created == NULL)
# 1495|->           return NULL;
# 1496|         }
# 1497|       if (src->author != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def34]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1501: error[memleak]: Memory leak: ret
# 1499|           ret->author = strdup (src->author);
# 1500|           if (ret->author == NULL)
# 1501|->           return NULL;
# 1502|         }
# 1503|       if (src->architecture != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def35]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1507: error[memleak]: Memory leak: ret
# 1505|           ret->architecture = strdup (src->architecture);
# 1506|           if (ret->architecture == NULL)
# 1507|->           return NULL;
# 1508|         }
# 1509|       if (src->variant != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def36]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1513: error[memleak]: Memory leak: ret
# 1511|           ret->variant = strdup (src->variant);
# 1512|           if (ret->variant == NULL)
# 1513|->           return NULL;
# 1514|         }
# 1515|       if (src->os != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def37]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1519: error[memleak]: Memory leak: ret
# 1517|           ret->os = strdup (src->os);
# 1518|           if (ret->os == NULL)
# 1519|->           return NULL;
# 1520|         }
# 1521|       if (src->os_version != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def38]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1525: error[memleak]: Memory leak: ret
# 1523|           ret->os_version = strdup (src->os_version);
# 1524|           if (ret->os_version == NULL)
# 1525|->           return NULL;
# 1526|         }
# 1527|       if (src->os_features)

Error: CPPCHECK_WARNING (CWE-401): [#def39]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_config_schema.c:1532: error[memleak]: Memory leak: ret
# 1530|           ret->os_features = calloc (src->os_features_len + 1, sizeof (*ret->os_features));
# 1531|           if (ret->os_features == NULL)
# 1532|->           return NULL;
# 1533|           for (size_t i = 0; i < src->os_features_len; i++)
# 1534|             {

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c: scope_hint: In function 'free_image_spec_schema_defs_map_string_object'
crun-HEAD/libocispec/src/ocispec/image_spec_schema_defs.c:126:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/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|   yajl_gen_status

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def63]
crun-HEAD/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 != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def64]
crun-HEAD/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): [#def65]
crun-HEAD/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): [#def66]
crun-HEAD/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): [#def67]
crun-HEAD/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): [#def68]
crun-HEAD/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): [#def69]
crun-HEAD/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): [#def70]
crun-HEAD/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): [#def71]
crun-HEAD/libocispec/src/ocispec/json_common.c:713: error[memleak]: Memory leak: ret
#  711|     if (ret->keys == NULL)
#  712|       {
#  713|->       return NULL;
#  714|       }
#  715|     ret->values = calloc (len + 1, sizeof (bool));

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def80]
crun-HEAD/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): [#def81]
crun-HEAD/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): [#def82]
crun-HEAD/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): [#def83]
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_string.part.0'
crun-HEAD/libocispec/src/ocispec/json_common.c:1479:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.keys + i * 8'
crun-HEAD/libocispec/src/ocispec/json_common.c:6: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_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): [#def84]
crun-HEAD/libocispec/src/ocispec/json_common.c:1481:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.values + i * 8'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.c: scope_hint: In function 'free_json_map_string_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): [#def85]
crun-HEAD/libocispec/src/ocispec/json_common.c:1521: error[memleak]: Memory leak: ret
# 1519|       {
# 1520|         *(err) = strdup ("error allocating memory");
# 1521|->       return NULL;
# 1522|       }
# 1523|   

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def89]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:447: error[memleak]: Memory leak: ret
#  445|           ret->mount = calloc (src->mount_len + 1, sizeof (*ret->mount));
#  446|           if (ret->mount == NULL)
#  447|->           return NULL;
#  448|           for (size_t i = 0; i < src->mount_len; i++)
#  449|             {

Error: CPPCHECK_WARNING (CWE-401): [#def90]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1071: error[memleak]: Memory leak: ret
# 1069|           ret->parent = strdup (src->parent);
# 1070|           if (ret->parent == NULL)
# 1071|->           return NULL;
# 1072|         }
# 1073|       if (src->host != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def91]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1077: error[memleak]: Memory leak: ret
# 1075|           ret->host = strdup (src->host);
# 1076|           if (ret->host == NULL)
# 1077|->           return NULL;
# 1078|         }
# 1079|       if (src->ip4 != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def92]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1083: error[memleak]: Memory leak: ret
# 1081|           ret->ip4 = strdup (src->ip4);
# 1082|           if (ret->ip4 == NULL)
# 1083|->           return NULL;
# 1084|         }
# 1085|       if (src->ip4addr)

Error: CPPCHECK_WARNING (CWE-401): [#def93]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1090: error[memleak]: Memory leak: ret
# 1088|           ret->ip4addr = calloc (src->ip4addr_len + 1, sizeof (*ret->ip4addr));
# 1089|           if (ret->ip4addr == NULL)
# 1090|->           return NULL;
# 1091|           for (size_t i = 0; i < src->ip4addr_len; i++)
# 1092|             {

Error: CPPCHECK_WARNING (CWE-401): [#def94]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1367: error[memleak]: Memory leak: ret
# 1365|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 1366|           if (ret->devices == NULL)
# 1367|->           return NULL;
# 1368|           for (size_t i = 0; i < src->devices_len; i++)
# 1369|             {

Error: CPPCHECK_WARNING (CWE-401): [#def95]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:33: error[memleak]: Memory leak: ret
#   31|           ret->keys = calloc (len + 1, sizeof (*ret->keys));
#   32|           if (ret->keys == NULL)
#   33|->           return NULL;
#   34|           ret->values = calloc (len + 1, sizeof (*ret->values));
#   35|           if (ret->values == NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def96]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:36: error[memleak]: Memory leak: ret
#   34|           ret->values = calloc (len + 1, sizeof (*ret->values));
#   35|           if (ret->values == NULL)
#   36|->           return NULL;
#   37|           for (i = 0; i < len; i++)
#   38|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_net_devices'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:73:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here.
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_net_devices'
#   71|           ptr->values = NULL;
#   72|       }
#   73|->     free (ptr);
#   74|       }
#   75|   yajl_gen_status

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

Error: CPPCHECK_WARNING (CWE-401): [#def99]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1234: error[memleak]: Memory leak: ret
# 1232|           ret->cpus = strdup (src->cpus);
# 1233|           if (ret->cpus == NULL)
# 1234|->           return NULL;
# 1235|         }
# 1236|       if (src->mems != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def100]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1240: error[memleak]: Memory leak: ret
# 1238|           ret->mems = strdup (src->mems);
# 1239|           if (ret->mems == NULL)
# 1240|->           return NULL;
# 1241|         }
# 1242|       ret->period = src->period;

Error: CPPCHECK_WARNING (CWE-401): [#def101]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1375: error[memleak]: Memory leak: ret
# 1373|           ret->page_size = strdup (src->page_size);
# 1374|           if (ret->page_size == NULL)
# 1375|->           return NULL;
# 1376|         }
# 1377|       ret->limit = src->limit;

Error: CPPCHECK_WARNING (CWE-401): [#def102]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2017: error[memleak]: Memory leak: ret
# 2015|           ret->priorities = calloc (src->priorities_len + 1, sizeof (*ret->priorities));
# 2016|           if (ret->priorities == NULL)
# 2017|->           return NULL;
# 2018|           for (size_t i = 0; i < src->priorities_len; i++)
# 2019|             {

Error: CPPCHECK_WARNING (CWE-401): [#def103]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2049: error[memleak]: Memory leak: ret
# 2047|           ret->keys = calloc (len + 1, sizeof (*ret->keys));
# 2048|           if (ret->keys == NULL)
# 2049|->           return NULL;
# 2050|           ret->values = calloc (len + 1, sizeof (*ret->values));
# 2051|           if (ret->values == NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def104]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2052: error[memleak]: Memory leak: ret
# 2050|           ret->values = calloc (len + 1, sizeof (*ret->values));
# 2051|           if (ret->values == NULL)
# 2052|->           return NULL;
# 2053|           for (i = 0; i < len; i++)
# 2054|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_resources_rdma'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2089:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_resources_rdma'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2040:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2040:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/json_common.h:42:7: note: in definition of macro 'define_cleaner_function'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'free_runtime_spec_schema_config_linux_resources_rdma'
# 2087|           ptr->values = NULL;
# 2088|       }
# 2089|->     free (ptr);
# 2090|       }
# 2091|   yajl_gen_status

Error: CPPCHECK_WARNING (CWE-401): [#def106]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2512: error[memleak]: Memory leak: ret
# 2510|       ret->unified = clone_map_string_string (src->unified);
# 2511|       if (ret->unified == NULL)
# 2512|->         return NULL;
# 2513|       if (src->devices)
# 2514|         {

Error: CPPCHECK_WARNING (CWE-401): [#def107]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2518: error[memleak]: Memory leak: ret
# 2516|           ret->devices = calloc (src->devices_len + 1, sizeof (*ret->devices));
# 2517|           if (ret->devices == NULL)
# 2518|->           return NULL;
# 2519|           for (size_t i = 0; i < src->devices_len; i++)
# 2520|             {

Error: CPPCHECK_WARNING (CWE-401): [#def108]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3016: error[memleak]: Memory leak: ret
# 3014|           ret->default_action = strdup (src->default_action);
# 3015|           if (ret->default_action == NULL)
# 3016|->           return NULL;
# 3017|         }
# 3018|       ret->default_errno_ret = src->default_errno_ret;

Error: CPPCHECK_WARNING (CWE-401): [#def109]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3025: error[memleak]: Memory leak: ret
# 3023|           ret->flags = calloc (src->flags_len + 1, sizeof (*ret->flags));
# 3024|           if (ret->flags == NULL)
# 3025|->           return NULL;
# 3026|           for (size_t i = 0; i < src->flags_len; i++)
# 3027|             {

Error: CPPCHECK_WARNING (CWE-401): [#def110]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3365: error[memleak]: Memory leak: ret
# 3363|           ret->clos_id = strdup (src->clos_id);
# 3364|           if (ret->clos_id == NULL)
# 3365|->           return NULL;
# 3366|         }
# 3367|       if (src->schemata)

Error: CPPCHECK_WARNING (CWE-401): [#def111]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3372: error[memleak]: Memory leak: ret
# 3370|           ret->schemata = calloc (src->schemata_len + 1, sizeof (*ret->schemata));
# 3371|           if (ret->schemata == NULL)
# 3372|->           return NULL;
# 3373|           for (size_t i = 0; i < src->schemata_len; i++)
# 3374|             {

Error: CPPCHECK_WARNING (CWE-401): [#def112]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3626: error[memleak]: Memory leak: ret
# 3624|           ret->mode = strdup (src->mode);
# 3625|           if (ret->mode == NULL)
# 3626|->           return NULL;
# 3627|         }
# 3628|       if (src->nodes != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def113]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3632: error[memleak]: Memory leak: ret
# 3630|           ret->nodes = strdup (src->nodes);
# 3631|           if (ret->nodes == NULL)
# 3632|->           return NULL;
# 3633|         }
# 3634|       if (src->flags)

Error: CPPCHECK_WARNING (CWE-401): [#def114]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3639: error[memleak]: Memory leak: ret
# 3637|           ret->flags = calloc (src->flags_len + 1, sizeof (*ret->flags));
# 3638|           if (ret->flags == NULL)
# 3639|->           return NULL;
# 3640|           for (size_t i = 0; i < src->flags_len; i++)
# 3641|             {

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def123]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:491: error[memleak]: Memory leak: ret
#  489|           ret->prestart = calloc (src->prestart_len + 1, sizeof (*ret->prestart));
#  490|           if (ret->prestart == NULL)
#  491|->           return NULL;
#  492|           for (size_t i = 0; i < src->prestart_len; i++)
#  493|             {

Error: CPPCHECK_WARNING (CWE-401): [#def124]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:738: error[memleak]: Memory leak: ret
#  736|           ret->path = strdup (src->path);
#  737|           if (ret->path == NULL)
#  738|->           return NULL;
#  739|         }
#  740|       ret->readonly = src->readonly;

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

Error: CPPCHECK_WARNING (CWE-401): [#def126]
crun-HEAD/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): [#def127]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1938: error[memleak]: Memory leak: ret
# 1936|           ret->_class = strdup (src->_class);
# 1937|           if (ret->_class == NULL)
# 1938|->           return NULL;
# 1939|         }
# 1940|       ret->priority = src->priority;

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def131]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2675: error[memleak]: Memory leak: ret
# 2673|           ret->initial = strdup (src->initial);
# 2674|           if (ret->initial == NULL)
# 2675|->           return NULL;
# 2676|         }
# 2677|       if (src->final != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def132]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2681: error[memleak]: Memory leak: ret
# 2679|           ret->final = strdup (src->final);
# 2680|           if (ret->final == NULL)
# 2681|->           return NULL;
# 2682|         }
# 2683|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def133]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3308: error[memleak]: Memory leak: ret
# 3306|           ret->args = calloc (src->args_len + 1, sizeof (*ret->args));
# 3307|           if (ret->args == NULL)
# 3308|->           return NULL;
# 3309|           for (size_t i = 0; i < src->args_len; i++)
# 3310|             {

Error: CPPCHECK_WARNING (CWE-401): [#def134]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3864: error[memleak]: Memory leak: ret
# 3862|           ret->oci_version = strdup (src->oci_version);
# 3863|           if (ret->oci_version == NULL)
# 3864|->           return NULL;
# 3865|         }
# 3866|       if (src->hooks)

Error: CPPCHECK_WARNING (CWE-401): [#def135]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3870: error[memleak]: Memory leak: ret
# 3868|           ret->hooks = clone_runtime_spec_schema_config_schema_hooks (src->hooks);
# 3869|           if (ret->hooks == NULL)
# 3870|->           return NULL;
# 3871|         }
# 3872|       ret->annotations = clone_map_string_string (src->annotations);

Error: CPPCHECK_WARNING (CWE-401): [#def136]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3874: error[memleak]: Memory leak: ret
# 3872|       ret->annotations = clone_map_string_string (src->annotations);
# 3873|       if (ret->annotations == NULL)
# 3874|->         return NULL;
# 3875|       if (src->hostname != NULL)
# 3876|         {

Error: CPPCHECK_WARNING (CWE-401): [#def137]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3879: error[memleak]: Memory leak: ret
# 3877|           ret->hostname = strdup (src->hostname);
# 3878|           if (ret->hostname == NULL)
# 3879|->           return NULL;
# 3880|         }
# 3881|       if (src->domainname != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def138]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3885: error[memleak]: Memory leak: ret
# 3883|           ret->domainname = strdup (src->domainname);
# 3884|           if (ret->domainname == NULL)
# 3885|->           return NULL;
# 3886|         }
# 3887|       if (src->mounts)

Error: CPPCHECK_WARNING (CWE-401): [#def139]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3892: error[memleak]: Memory leak: ret
# 3890|           ret->mounts = calloc (src->mounts_len + 1, sizeof (*ret->mounts));
# 3891|           if (ret->mounts == NULL)
# 3892|->           return NULL;
# 3893|           for (size_t i = 0; i < src->mounts_len; i++)
# 3894|             {

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

Error: CPPCHECK_WARNING (CWE-401): [#def141]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:310: error[memleak]: Memory leak: ret
#  308|           ret->physical = strdup (src->physical);
#  309|           if (ret->physical == NULL)
#  310|->           return NULL;
#  311|         }
#  312|       if (src->swap != NULL)

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

Error: CPPCHECK_WARNING (CWE-401): [#def143]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:553: error[memleak]: Memory leak: ret
#  551|           ret->linkname = strdup (src->linkname);
#  552|           if (ret->linkname == NULL)
#  553|->           return NULL;
#  554|         }
#  555|       if (src->lower_link != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def144]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:559: error[memleak]: Memory leak: ret
#  557|           ret->lower_link = strdup (src->lower_link);
#  558|           if (ret->lower_link == NULL)
#  559|->           return NULL;
#  560|         }
#  561|       if (src->allowed_address != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def145]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:565: error[memleak]: Memory leak: ret
#  563|           ret->allowed_address = strdup (src->allowed_address);
#  564|           if (ret->allowed_address == NULL)
#  565|->           return NULL;
#  566|         }
#  567|       if (src->configure_allowed_address != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def146]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:571: error[memleak]: Memory leak: ret
#  569|           ret->configure_allowed_address = strdup (src->configure_allowed_address);
#  570|           if (ret->configure_allowed_address == NULL)
#  571|->           return NULL;
#  572|         }
#  573|       if (src->defrouter != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def147]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:577: error[memleak]: Memory leak: ret
#  575|           ret->defrouter = strdup (src->defrouter);
#  576|           if (ret->defrouter == NULL)
#  577|->           return NULL;
#  578|         }
#  579|       if (src->mac_address != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def148]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:583: error[memleak]: Memory leak: ret
#  581|           ret->mac_address = strdup (src->mac_address);
#  582|           if (ret->mac_address == NULL)
#  583|->           return NULL;
#  584|         }
#  585|       if (src->link_protection != NULL)

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

Error: CPPCHECK_WARNING (CWE-401): [#def150]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:879: error[memleak]: Memory leak: ret
#  877|           ret->milestone = strdup (src->milestone);
#  878|           if (ret->milestone == NULL)
#  879|->           return NULL;
#  880|         }
#  881|       if (src->limitpriv != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def151]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:885: error[memleak]: Memory leak: ret
#  883|           ret->limitpriv = strdup (src->limitpriv);
#  884|           if (ret->limitpriv == NULL)
#  885|->           return NULL;
#  886|         }
#  887|       if (src->max_shm_memory != NULL)

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def160]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:669: error[memleak]: Memory leak: ret
#  667|           ret->path = strdup (src->path);
#  668|           if (ret->path == NULL)
#  669|->           return NULL;
#  670|         }
#  671|       if (src->format != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def161]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:675: error[memleak]: Memory leak: ret
#  673|           ret->format = strdup (src->format);
#  674|           if (ret->format == NULL)
#  675|->           return NULL;
#  676|         }
#  677|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def162]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1076: error[memleak]: Memory leak: ret
# 1074|           ret->device_tree = strdup (src->device_tree);
# 1075|           if (ret->device_tree == NULL)
# 1076|->           return NULL;
# 1077|         }
# 1078|       ret->vcpus = src->vcpus;

Error: CPPCHECK_WARNING (CWE-401): [#def163]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1087: error[memleak]: Memory leak: ret
# 1085|           ret->dtdevs = calloc (src->dtdevs_len + 1, sizeof (*ret->dtdevs));
# 1086|           if (ret->dtdevs == NULL)
# 1087|->           return NULL;
# 1088|           for (size_t i = 0; i < src->dtdevs_len; i++)
# 1089|             {

Error: CPPCHECK_WARNING (CWE-401): [#def164]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1139: error[memleak]: Memory leak: ret
# 1137|       ret->hypervisor = make_runtime_spec_schema_config_vm_hypervisor (get_val (tree, "hypervisor", yajl_t_object), ctx, err);
# 1138|       if (ret->hypervisor == NULL && *err != 0)
# 1139|->       return NULL;
# 1140|       ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
# 1141|       if (ret->kernel == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def165]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1142: error[memleak]: Memory leak: ret
# 1140|       ret->kernel = make_runtime_spec_schema_config_vm_kernel (get_val (tree, "kernel", yajl_t_object), ctx, err);
# 1141|       if (ret->kernel == NULL && *err != 0)
# 1142|->       return NULL;
# 1143|       ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
# 1144|       if (ret->image == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def166]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1145: error[memleak]: Memory leak: ret
# 1143|       ret->image = make_runtime_spec_schema_config_vm_image (get_val (tree, "image", yajl_t_object), ctx, err);
# 1144|       if (ret->image == NULL && *err != 0)
# 1145|->       return NULL;
# 1146|       ret->hw_config = make_runtime_spec_schema_config_vm_hw_config (get_val (tree, "hwConfig", yajl_t_object), ctx, err);
# 1147|       if (ret->hw_config == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def167]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1148: error[memleak]: Memory leak: ret
# 1146|       ret->hw_config = make_runtime_spec_schema_config_vm_hw_config (get_val (tree, "hwConfig", yajl_t_object), ctx, err);
# 1147|       if (ret->hw_config == NULL && *err != 0)
# 1148|->       return NULL;
# 1149|       if (ret->kernel == NULL)
# 1150|         {

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def172]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1309: error[memleak]: Memory leak: ret
# 1307|           ret->hypervisor = clone_runtime_spec_schema_config_vm_hypervisor (src->hypervisor);
# 1308|           if (ret->hypervisor == NULL)
# 1309|->           return NULL;
# 1310|         }
# 1311|       if (src->kernel)

Error: CPPCHECK_WARNING (CWE-401): [#def173]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1315: error[memleak]: Memory leak: ret
# 1313|           ret->kernel = clone_runtime_spec_schema_config_vm_kernel (src->kernel);
# 1314|           if (ret->kernel == NULL)
# 1315|->           return NULL;
# 1316|         }
# 1317|       if (src->image)

Error: CPPCHECK_WARNING (CWE-401): [#def174]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1321: error[memleak]: Memory leak: ret
# 1319|           ret->image = clone_runtime_spec_schema_config_vm_image (src->image);
# 1320|           if (ret->image == NULL)
# 1321|->           return NULL;
# 1322|         }
# 1323|       if (src->hw_config)

Error: CPPCHECK_WARNING (CWE-401): [#def175]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1327: error[memleak]: Memory leak: ret
# 1325|           ret->hw_config = clone_runtime_spec_schema_config_vm_hw_config (src->hw_config);
# 1326|           if (ret->hw_config == NULL)
# 1327|->           return NULL;
# 1328|         }
# 1329|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def176]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:568: error[memleak]: Memory leak: ret
#  566|           ret->affinity = clone_runtime_spec_schema_config_windows_resources_cpu_affinity (src->affinity);
#  567|           if (ret->affinity == NULL)
#  568|->           return NULL;
#  569|         }
#  570|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def177]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:803: error[memleak]: Memory leak: ret
#  801|       ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
#  802|       if (ret->memory == NULL && *err != 0)
#  803|->       return NULL;
#  804|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
#  805|       if (ret->cpu == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def178]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:806: error[memleak]: Memory leak: ret
#  804|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);
#  805|       if (ret->cpu == NULL && *err != 0)
#  806|->       return NULL;
#  807|       ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
#  808|       if (ret->storage == NULL && *err != 0)

Error: CPPCHECK_WARNING (CWE-401): [#def179]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:809: error[memleak]: Memory leak: ret
#  807|       ret->storage = make_runtime_spec_schema_config_windows_resources_storage (get_val (tree, "storage", yajl_t_object), ctx, err);
#  808|       if (ret->storage == NULL && *err != 0)
#  809|->       return NULL;
#  810|       if (tree->type == yajl_t_object)
#  811|         {

Error: CPPCHECK_WARNING (CWE-401): [#def180]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:821: error[memleak]: Memory leak: ret
#  819|               resi = calloc (1, sizeof(*tree));
#  820|               if (resi == NULL)
#  821|->               return NULL;
#  822|   
#  823|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def181]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:828: error[memleak]: Memory leak: ret
#  826|                 {
#  827|                   yajl_tree_free (resi);
#  828|->                 return NULL;
#  829|                 }
#  830|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def182]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:834: error[memleak]: Memory leak: ret
#  832|                 {
#  833|                   yajl_tree_free (resi);
#  834|->                 return NULL;
#  835|                 }
#  836|             }

Error: CPPCHECK_WARNING (CWE-401): [#def183]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:949: error[memleak]: Memory leak: ret
#  947|           ret->memory = clone_runtime_spec_schema_config_windows_resources_memory (src->memory);
#  948|           if (ret->memory == NULL)
#  949|->           return NULL;
#  950|         }
#  951|       if (src->cpu)

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

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

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

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def195]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_freebsd.c:180: error[memleak]: Memory leak: ret
#  178|           ret->path = strdup (src->path);
#  179|           if (ret->path == NULL)
#  180|->           return NULL;
#  181|         }
#  182|       ret->mode = src->mode;

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def201]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1178: error[memleak]: Memory leak: ret
# 1176|           ret->type = strdup (src->type);
# 1177|           if (ret->type == NULL)
# 1178|->           return NULL;
# 1179|         }
# 1180|       if (src->path != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def202]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1184: error[memleak]: Memory leak: ret
# 1182|           ret->path = strdup (src->path);
# 1183|           if (ret->path == NULL)
# 1184|->           return NULL;
# 1185|         }
# 1186|       ret->file_mode = src->file_mode;

Error: CPPCHECK_WARNING (CWE-401): [#def203]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1332: error[memleak]: Memory leak: ret
# 1330|           ret->name = strdup (src->name);
# 1331|           if (ret->name == NULL)
# 1332|->           return NULL;
# 1333|         }
# 1334|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def204]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2249: error[memleak]: Memory leak: ret
# 2247|           ret->type = strdup (src->type);
# 2248|           if (ret->type == NULL)
# 2249|->           return NULL;
# 2250|         }
# 2251|       ret->major = src->major;

Error: CPPCHECK_WARNING (CWE-401): [#def205]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2259: error[memleak]: Memory leak: ret
# 2257|           ret->access = strdup (src->access);
# 2258|           if (ret->access == NULL)
# 2259|->           return NULL;
# 2260|         }
# 2261|       return move_ptr (ret);

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

Error: CPPCHECK_WARNING (CWE-401): [#def207]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2438: error[memleak]: Memory leak: ret
# 2436|           ret->name = strdup (src->name);
# 2437|           if (ret->name == NULL)
# 2438|->           return NULL;
# 2439|         }
# 2440|       ret->priority = src->priority;

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def210]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2790: error[memleak]: Memory leak: ret
# 2788|           ret->type = strdup (src->type);
# 2789|           if (ret->type == NULL)
# 2790|->           return NULL;
# 2791|         }
# 2792|       if (src->path != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def211]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2796: error[memleak]: Memory leak: ret
# 2794|           ret->path = strdup (src->path);
# 2795|           if (ret->path == NULL)
# 2796|->           return NULL;
# 2797|         }
# 2798|       return move_ptr (ret);

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def218]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:178: error[memleak]: Memory leak: ret
#  176|           ret->type = strdup (src->type);
#  177|           if (ret->type == NULL)
#  178|->           return NULL;
#  179|         }
#  180|       if (src->path != NULL)

Error: CPPCHECK_WARNING (CWE-401): [#def219]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_zos.c:184: error[memleak]: Memory leak: ret
#  182|           ret->path = strdup (src->path);
#  183|           if (ret->path == NULL)
#  184|->           return NULL;
#  185|         }
#  186|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def220]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:758: error[memleak]: Memory leak: ret
#  756|           ret->actions = calloc (src->actions_len + 1, sizeof (*ret->actions));
#  757|           if (ret->actions == NULL)
#  758|->           return NULL;
#  759|           for (size_t i = 0; i < src->actions_len; i++)
#  760|             {

Error: CPPCHECK_WARNING (CWE-401): [#def221]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1406: error[memleak]: Memory leak: ret
# 1404|       ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1405|       if (ret->idmap == NULL && *err != 0)
# 1406|->       return NULL;
# 1407|       if (tree->type == yajl_t_object)
# 1408|         {

Error: CPPCHECK_WARNING (CWE-401): [#def222]
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1418: error[memleak]: Memory leak: ret
# 1416|               resi = calloc (1, sizeof(*tree));
# 1417|               if (resi == NULL)
# 1418|->               return NULL;
# 1419|   
# 1420|               resi->type = yajl_t_object;

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

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

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

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

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-457): [#def235]
crun-HEAD/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-688): [#def236]
crun-HEAD/src/libcrun/cgroup-setup.c: scope_hint: In function 'initialize_cpuset_subsystem'
crun-HEAD/src/libcrun/cgroup-setup.c:155:10: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
crun-HEAD/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-HEAD/src/libcrun/container.h:23: included_from: Included from here.
/usr/include/string.h:439:15: note: argument 1 of '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): [#def237]
crun-HEAD/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2'
crun-HEAD/src/libcrun/cgroup-setup.c:470:15: warning[-Wanalyzer-null-argument]: use of NULL 'cgroup_crun_exec_path' where non-null expected
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/cgroup-setup.c: scope_hint: In function 'enter_cgroup_v2'
/usr/include/string.h:174:12: note: argument 2 of 'strncmp' must be non-null
#  468|   
#  469|             /* Make sure the cgroup is below the initial cgroup specified for the container.  */
#  470|->           if (strncmp (path, cgroup_crun_exec_path, strlen (path)))
#  471|               {
#  472|                 free (cgroup_crun_exec_path);

Error: COMPILER_WARNING (CWE-704): [#def238]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'get_systemd_scope_and_slice'
crun-HEAD/src/libcrun/cgroup-systemd.c:125:5: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  123|       }
#  124|   
#  125|->   n = strchr (cgroup_path, ':');
#  126|     if (n == NULL)
#  127|       xasprintf (scope, "%s.scope", cgroup_path);

Error: COMPILER_WARNING (CWE-704): [#def239]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'append_systemd_annotation'
crun-HEAD/src/libcrun/cgroup-systemd.c:641:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  639|         it = v_start = xstrdup (value);
#  640|   
#  641|->       end = strchr (it + 1, '\'');
#  642|         if (end == NULL)
#  643|           return crun_make_error (err, 0, "invalid variant `%s`", value);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def240]
crun-HEAD/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_destroy'
crun-HEAD/src/libcrun/cgroup.c:208:24: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  206|       return ret;
#  207|   
#  208|->   return cgroup_manager->destroy_cgroup (cgroup_status, err);
#  209|   }
#  210|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
crun-HEAD/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_update_cgroup_resources'
crun-HEAD/src/libcrun/cgroup.c:224:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  222|       return ret;
#  223|   
#  224|->   if (cgroup_manager->update_resources)
#  225|       {
#  226|         ret = cgroup_manager->update_resources (cgroup_status, state_root, resources, err);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def242]
crun-HEAD/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_preenter'
crun-HEAD/src/libcrun/cgroup.c:282:21: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  280|       return ret;
#  281|   
#  282|->   if (cgroup_manager->precreate_cgroup == NULL)
#  283|       return 0;
#  284|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
crun-HEAD/src/libcrun/cgroup.c: scope_hint: In function 'libcrun_cgroup_enter'
crun-HEAD/src/libcrun/cgroup.c:323:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
#  321|     status->manager = args->manager;
#  322|   
#  323|->   ret = cgroup_manager->create_cgroup (args, status, err);
#  324|     if (UNLIKELY (ret < 0))
#  325|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
crun-HEAD/src/libcrun/cloned_binary.c: scope_hint: In function 'fetchve'
crun-HEAD/src/libcrun/cloned_binary.c:191:40: warning[-Wanalyzer-malloc-leak]: leak of 'read_file("/proc/self/cmdline", &cmdline_size)'
crun-HEAD/src/libcrun/cloned_binary.c:61: included_from: Included from here.
#  189|   			break;
#  190|   
#  191|-> 		copy = xrealloc(copy, (*length + n) * sizeof(*copy));
#  192|   		memcpy(copy + *length, buf, n);
#  193|   		*length += n;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
crun-HEAD/src/libcrun/cloned_binary.c: scope_hint: In function 'parse_xargs'
crun-HEAD/src/libcrun/cloned_binary.c:223:24: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  221|   		cur += strlen(cur) + 1;
#  222|   	}
#  223|-> 	(*output)[num] = NULL;
#  224|   	return num;
#  225|   }

Error: GCC_ANALYZER_WARNING (CWE-415): [#def246]
crun-HEAD/src/libcrun/cloned_binary.c: scope_hint: In function 'fetchve'
crun-HEAD/src/libcrun/cloned_binary.c:247:9: warning[-Wanalyzer-double-free]: double-'free' of '0'
#  245|   
#  246|   error:
#  247|-> 	free(cmdline);
#  248|   	return -EINVAL;
#  249|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def247]
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c:3985:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'process'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3983|   
# 3984|     /* This must be done before we enter a user namespace.  */
# 3985|->   ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3986|     if (UNLIKELY (ret < 0))
# 3987|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
crun-HEAD/src/libcrun/container.c:4000:32: warning[-Wanalyzer-malloc-leak]: leak of '*process.selinux_label'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 3998|       {
# 3999|         if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 4000|->         process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 4001|   
# 4002|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
crun-HEAD/src/libcrun/container.c:4003:35: warning[-Wanalyzer-malloc-leak]: leak of '*process.apparmor_profile'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 4001|   
# 4002|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 4003|->         process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 4004|   
# 4005|         if (process->user == NULL && container->container_def->process->user)

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def250]
crun-HEAD/src/libcrun/container.c:4029:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd0'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
# 4027|     if (pid == 0)
# 4028|       {
# 4029|->       TEMP_FAILURE_RETRY (close (pipefd0));
# 4030|         pipefd0 = -1;
# 4031|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def251]
crun-HEAD/src/libcrun/container.c:4044:35: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
# 4042|                 TEMP_FAILURE_RETRY (write (pipefd1, &ret, sizeof (ret)));
# 4043|                 TEMP_FAILURE_RETRY (write (pipefd1, msg, strlen (msg) + 1));
# 4044|->               TEMP_FAILURE_RETRY (close (pipefd1));
# 4045|                 pipefd1 = -1;
# 4046|               }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def252]
crun-HEAD/src/libcrun/container.c:4051:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
# 4049|       }
# 4050|   
# 4051|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 4052|     pipefd1 = -1;
# 4053|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def253]
crun-HEAD/src/libcrun/criu.c: scope_hint: In function 'restore_cgroup_v1_mount'
crun-HEAD/src/libcrun/criu.c:369:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
/usr/include/features.h:540: included_from: Included from here.
/usr/include/unistd.h:25: included_from: Included from here.
#  367|         subsystem = strchr (from, ':') + 1;
#  368|         subpath = strchr (subsystem, ':') + 1;
#  369|->       *(subpath - 1) = '\0';
#  370|   
#  371|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
crun-HEAD/src/libcrun/criu.c:371:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  369|         *(subpath - 1) = '\0';
#  370|   
#  371|->       if (subsystem[0] == '\0')
#  372|           continue;
#  373|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def255]
crun-HEAD/src/libcrun/criu.c: scope_hint: In function 'checkpoint_cgroup_v1_mount'
crun-HEAD/src/libcrun/criu.c:439:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  437|         subsystem = strchr (from, ':') + 1;
#  438|         subpath = strchr (subsystem, ':') + 1;
#  439|->       *(subpath - 1) = '\0';
#  440|   
#  441|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
crun-HEAD/src/libcrun/criu.c:441:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  439|         *(subpath - 1) = '\0';
#  440|   
#  441|->       if (subsystem[0] == '\0')
#  442|           continue;
#  443|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def257]
crun-HEAD/src/libcrun/ebpf.c: scope_hint: In function 'read_all_progs'
crun-HEAD/src/libcrun/ebpf.c:294:18: warning[-Wanalyzer-infinite-loop]: infinite loop
crun-HEAD/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: COMPILER_WARNING (CWE-704): [#def258]
crun-HEAD/src/libcrun/error.c: scope_hint: In function 'get_log_type'
crun-HEAD/src/libcrun/error.c:194:15: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  192|   get_log_type (const char *log, const char **data)
#  193|   {
#  194|->   char *sep = strchr (log, ':');
#  195|     if (sep == NULL)
#  196|       {

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

Error: CPPCHECK_WARNING (CWE-457): [#def260]
crun-HEAD/src/libcrun/linux.c:3869: error[uninitvar]: Uninitialized variable: code
# 3867|         if (UNLIKELY (ret < 0))
# 3868|           return false;
# 3869|->       *error = code;
# 3870|       }
# 3871|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def261]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'join_namespaces'
crun-HEAD/src/libcrun/linux.c:4026:17: warning[-Wanalyzer-null-argument]: use of NULL 'cwd' where non-null expected
/usr/include/unistd.h:517:12: note: argument 1 of 'chdir' must be non-null
# 4024|         if (value == CLONE_NEWNS)
# 4025|           {
# 4026|->           ret = chdir (cwd);
# 4027|             if (UNLIKELY (ret < 0))
# 4028|               return crun_make_error (err, errno, "chdir `%s`", cwd);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def262]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_join_process'
crun-HEAD/src/libcrun/linux.c:5727:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[0]'
# 5725|   exit:
# 5726|     if (sync_socket_fd[0] >= 0)
# 5727|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5728|     if (sync_socket_fd[1] >= 0)
# 5729|       TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def263]
crun-HEAD/src/libcrun/linux.c:5729:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[1]'
# 5727|       TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5728|     if (sync_socket_fd[1] >= 0)
# 5729|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));
# 5730|     return ret;
# 5731|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_make_runtime_mounts'
crun-HEAD/src/libcrun/linux.c:6358:1: warning[-Wanalyzer-malloc-leak]: leak of 'data'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_make_runtime_mounts'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_make_runtime_mounts'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_make_runtime_mounts'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_make_runtime_mounts'
# 6356|   
# 6357|     return run_in_container_namespace (status, do_mount_in_a_container, &args, err);
# 6358|-> }
# 6359|   
# 6360|   int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'cleanup_ip_addrsp'
crun-HEAD/src/libcrun/net_device.c:92:3: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'cleanup_ip_addrsp'
#   90|       free (ip->rta);
#   91|   
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def266]
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'open_rundir_dirfd'
crun-HEAD/src/libcrun/seccomp.c:471:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor '<unknown>'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  469|   
#  470|     dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
#  471|->   if (UNLIKELY (dirfd < 0))
#  472|       return crun_make_error (err, errno, "open `%s`", dir);
#  473|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def267]
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'evict_cache'
crun-HEAD/src/libcrun/seccomp.c:568:7: warning[-Wanalyzer-null-argument]: use of NULL 'entries' where non-null expected
crun-HEAD/src/libcrun/seccomp.h:22: included_from: Included from here.
/usr/include/stdlib.h:998:13: note: argument 1 of 'qsort' must be non-null
#  566|           }
#  567|   
#  568|->       qsort (entries, n_entries, sizeof (struct cache_entry), compare_entries_by_atime);
#  569|   
#  570|         /* Attempt to delete half of them.  */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-HEAD/src/libcrun/seccomp.c:597:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '**ctx.container.context'
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
#  595|   
#  596|     /* relative path to dirfd.  */
#  597|->   ret = append_paths (&src_path, err, container->context->id, "seccomp.bpf", NULL);
#  598|     if (UNLIKELY (ret < 0))
#  599|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def269]
crun-HEAD/src/libcrun/seccomp.c:597:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '*container.context'
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
crun-HEAD/src/libcrun/seccomp.c: scope_hint: In function 'store_seccomp_cache'
#  595|   
#  596|     /* relative path to dirfd.  */
#  597|->   ret = append_paths (&src_path, err, container->context->id, "seccomp.bpf", NULL);
#  598|     if (UNLIKELY (ret < 0))
#  599|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'get_run_directory'
crun-HEAD/src/libcrun/status.c:86:1: warning[-Wanalyzer-malloc-leak]: leak of 'root'
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'get_run_directory'
#   84|   
#   85|     return 0;
#   86|-> }
#   87|   
#   88|   int

Error: GCC_ANALYZER_WARNING (CWE-775): [#def271]
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
crun-HEAD/src/libcrun/status.c:620:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'rundir_dfd'
crun-HEAD/src/libcrun/status.c:83:3: note: in expansion of macro 'STEAL_POINTER'
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'libcrun_container_delete_status'
#  618|   
#  619|     return 0;
#  620|-> }
#  621|   
#  622|   void

Error: COMPILER_WARNING (CWE-704): [#def272]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'crun_safe_ensure_at'
crun-HEAD/src/libcrun/utils.c:576:10: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  576 |       it = strchr (cur, '/');
#      |          ^
#  574|         cur = consume_slashes (it + 1);
#  575|         *it = '/';
#  576|->       it = strchr (cur, '/');
#  577|       }
#  578|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def273]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_child'
crun-HEAD/src/libcrun/utils.c:1645:23: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipe_w'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_child'
# 1643|       }
# 1644|   
# 1645|->   TEMP_FAILURE_RETRY (close (pipe_w));
# 1646|     dup2 (pipe_r, 0);
# 1647|     TEMP_FAILURE_RETRY (close (pipe_r));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def274]
crun-HEAD/src/libcrun/utils.c:1658:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dev_null_fd'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_child'
# 1656|   
# 1657|     if (dev_null_fd >= 0)
# 1658|->     TEMP_FAILURE_RETRY (close (dev_null_fd));
# 1659|     if (out_fd >= 0)
# 1660|       TEMP_FAILURE_RETRY (close (out_fd));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def275]
crun-HEAD/src/libcrun/utils.c:1660:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'out_fd'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_child'
# 1658|       TEMP_FAILURE_RETRY (close (dev_null_fd));
# 1659|     if (out_fd >= 0)
# 1660|->     TEMP_FAILURE_RETRY (close (out_fd));
# 1661|     if (err_fd >= 0)
# 1662|       TEMP_FAILURE_RETRY (close (err_fd));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def276]
crun-HEAD/src/libcrun/utils.c:1790:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipe_r'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_with_stdin_timeout_envp'
# 1788|       }
# 1789|     return ret;
# 1790|-> }
# 1791|   
# 1792|   int

Error: GCC_ANALYZER_WARNING (CWE-775): [#def277]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_with_stdin_timeout_envp'
crun-HEAD/src/libcrun/utils.c:1790:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipe_w'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_with_stdin_timeout_envp'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_with_stdin_timeout_envp'
# 1788|       }
# 1789|     return ret;
# 1790|-> }
# 1791|   
# 1792|   int

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'find_executable'
crun-HEAD/src/libcrun/utils.c:1990:22: warning[-Wanalyzer-null-dereference]: dereference of NULL 'executable_path'
/usr/include/features.h:540: 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-HEAD/src/libcrun/utils.h:22: included_from: Included from here.
# 1988|   
# 1989|     /* Absolute path.  It doesn't need to lookup $PATH.  */
# 1990|->   if (executable_path[0] == '/')
# 1991|       {
# 1992|         ret = check_access (executable_path);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def279]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-HEAD/src/libcrun/utils.c:2188:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcdirfd'
# 2186|     if (UNLIKELY (dsrcfd == NULL))
# 2187|       {
# 2188|->       TEMP_FAILURE_RETRY (close (srcdirfd));
# 2189|         return crun_make_error (err, errno, "open directory `%s`", destname);
# 2190|       }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def280]
crun-HEAD/src/libcrun/utils.c:2232:31: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
# 2230|   #endif
# 2231|   
# 2232|->           TEMP_FAILURE_RETRY (close (destfd));
# 2233|             destfd = -1;
# 2234|             break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def281]
crun-HEAD/src/libcrun/utils.c:2267: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
# 2265|               return ret;
# 2266|   
# 2267|->           ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2268|             if (UNLIKELY (ret < 0))
# 2269|               return crun_make_error (err, errno, "symlinkat `%s/%s`", destname, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def282]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'read_file_as_long_or_default'
crun-HEAD/src/libcrun/utils.c:2580:9: warning[-Wanalyzer-null-argument]: use of NULL 'content' where non-null expected
/usr/include/stdlib.h:219:17: note: argument 1 of 'strtol' must be non-null
# 2578|   
# 2579|     errno = 0;
# 2580|->   val = strtol (content, &endptr, 10);
# 2581|     if (UNLIKELY (errno))
# 2582|       return def_value;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def283]
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'libcrun_open_proc_file'
crun-HEAD/src/libcrun/utils.c:2881:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'libcrun_open_proc_file'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'libcrun_open_proc_file'
# 2879|     /* requires closing if not cached */
# 2880|     if (! container)
# 2881|->     TEMP_FAILURE_RETRY (close (proc_fd));
# 2882|   
# 2883|     if (UNLIKELY (fd < 0))

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def284]
crun-HEAD/src/libcrun/utils.c:2881:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'libcrun_get_cached_proc_fd(container,  err)'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'libcrun_open_proc_file'
# 2879|     /* requires closing if not cached */
# 2880|     if (! container)
# 2881|->     TEMP_FAILURE_RETRY (close (proc_fd));
# 2882|   
# 2883|     if (UNLIKELY (fd < 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
crun-HEAD/src/exec.c:30: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'make_oci_process_user'
crun-HEAD/src/libcrun/utils.h:74:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(56)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
crun-HEAD/src/libcrun/utils.c:21: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'xrealloc'
crun-HEAD/src/libcrun/utils.h:82:15: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#   80|   xrealloc (void *ptr, size_t size)
#   81|   {
#   82|->   void *res = realloc (ptr, size);
#   83|     if (UNLIKELY (res == NULL))
#   84|       OOM ();

Error: GCC_ANALYZER_WARNING (CWE-415): [#def287]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'progs'
crun-HEAD/src/libcrun/ebpf.c: scope_hint: In function 'read_all_progs'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def288]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'tmp_buf'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'safe_readlinkat'
crun-HEAD/src/libcrun/utils.h:24: included_from: Included from here.
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def289]
crun-HEAD/src/libcrun/error.h:42: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h:26: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*(void *)p'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def290]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def291]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cfd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/status.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def292]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cgroup_dirfd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def293]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cgroup_fd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def294]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'client_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:3971:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def295]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'console_socket_fd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def296]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dest_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def297]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destdirfd'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def298]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'devfd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def299]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def300]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_blkio'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c:299:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def301]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_cpu'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c:1052:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def302]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_cpuset'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def303]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_devs'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def304]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_htlb'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def305]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_mem'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c:928:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def306]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netclass'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def307]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_netprio'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-resources.c:487:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def308]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd_pid'
crun-HEAD/src/libcrun/cgroup-resources.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def309]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-HEAD/src/libcrun/cgroup.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def310]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd_cleanup'
crun-HEAD/src/libcrun/utils.h:24: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def311]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'gid_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def312]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'map_fd'
/usr/include/features.h:540: 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-HEAD/src/libcrun/linux.h:21: included_from: Included from here.
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:364:20: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def313]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/seccomp.h:24: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def314]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'nfd'
crun-HEAD/src/libcrun/cgroup-utils.c:654:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c:654:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def315]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipe_r'
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def316]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipe_w'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def317]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'root_fd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def318]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rootfsfd_cleanup'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def319]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sock'
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def320]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sock_in_ns'
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def321]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'tasksfd'
crun-HEAD/src/libcrun/cgroup-utils.c:654:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c:654:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/cgroup-utils.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def322]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'uid_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def323]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'wfd'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def324]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_set_stdio'
crun-HEAD/src/libcrun/utils.h:109:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'ret'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_set_stdio'
#  107|     if (*pp >= 0)
#  108|       TEMP_FAILURE_RETRY (close (*pp));
#  109|-> }
#  110|   
#  111|   static inline void

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def325]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '**cgroup_dirfd.dirfd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def326]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*fd'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def327]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'gid_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:443:16: note: in expansion of macro 'crun_make_error'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def328]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def329]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'own_seccomp_receiver_fd'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def330]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipe_r'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def331]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipe_w'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def332]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_fd'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def333]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_receiver_fd'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def334]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'targetfd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c:3971:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def335]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'terminal_fd'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def336]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/utils.h:227:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*str'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/linux.c:3752:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'xstrdup'
crun-HEAD/libocispec/src/ocispec/json_common.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_schema.h:7: included_from: Included from here.
crun-HEAD/src/libcrun/linux.h:27: included_from: Included from here.
/usr/include/string.h:202:14: note: argument 1 of 'strdup' must be a pointer to a null-terminated string
#  225|       return NULL;
#  226|   
#  227|->   ret = strdup (str);
#  228|     if (ret == NULL)
#  229|       OOM ();

Scan Properties

analyzer-version-clippy1.94.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.0.1
analyzer-version-gcc-analyzer16.0.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-143.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260308.181716.g94c371b.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.26-1.20260310140555736157.main.138.gd268d537
store-results-to/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.tar.xz
time-created2026-03-11 09:27:14
time-finished2026-03-11 09:31:38
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,clippy,cppcheck,shellcheck,gcc' '-o' '/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp3oswt7by/crun-1.26-1.20260310140555736157.main.138.gd268d537.src.rpm'
tool-versioncsmock-3.8.4.20260302.153719.g8203630-1.el9