Task #106025 - crun-1.26-1.20260320150616097532.main.176.g8d0bacde/scan-results.err
back to task #106025download
Error: CPPCHECK_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
crun-HEAD/src/libcrun/container.c: scope_hint: In function 'libcrun_container_exec_with_options'
crun-HEAD/src/libcrun/container.c:4009: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'
# 4007|
# 4008| /* This must be done before we enter a user namespace. */
# 4009|-> ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 4010| if (UNLIKELY (ret < 0))
# 4011| return ret;
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/container.c:4024: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'
# 4022| {
# 4023| if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 4024|-> process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 4025|
# 4026| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/container.c:4027: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'
# 4025|
# 4026| if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 4027|-> process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 4028|
# 4029| if (process->user == NULL && container->container_def->process->user)
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/container.c:4053: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'
# 4051| if (pid == 0)
# 4052| {
# 4053|-> TEMP_FAILURE_RETRY (close (pipefd0));
# 4054| pipefd0 = -1;
# 4055|
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/container.c:4068: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'
# 4066| TEMP_FAILURE_RETRY (write (pipefd1, &ret, sizeof (ret)));
# 4067| TEMP_FAILURE_RETRY (write (pipefd1, msg, strlen (msg) + 1));
# 4068|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 4069| pipefd1 = -1;
# 4070| }
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/container.c:4075: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'
# 4073| }
# 4074|
# 4075|-> TEMP_FAILURE_RETRY (close (pipefd1));
# 4076| pipefd1 = -1;
# 4077|
Error: GCC_ANALYZER_WARNING (CWE-476):
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):
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):
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):
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):
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):
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):
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):
crun-HEAD/src/libcrun/linux.c:3972: error[uninitvar]: Uninitialized variable: code
# 3970| if (UNLIKELY (ret < 0))
# 3971| return false;
# 3972|-> *error = code;
# 3973| }
# 3974|
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'crun_safe_ensure_at'
crun-HEAD/src/libcrun/utils.c:578:10: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 576| cur = consume_slashes (it + 1);
# 577| *it = '/';
# 578|-> it = strchr (cur, '/');
# 579| }
# 580|
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_child'
crun-HEAD/src/libcrun/utils.c:1683: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'
# 1681| }
# 1682|
# 1683|-> TEMP_FAILURE_RETRY (close (pipe_w));
# 1684| dup2 (pipe_r, 0);
# 1685| TEMP_FAILURE_RETRY (close (pipe_r));
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c:1696: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'
# 1694|
# 1695| if (dev_null_fd >= 0)
# 1696|-> TEMP_FAILURE_RETRY (close (dev_null_fd));
# 1697| if (out_fd >= 0)
# 1698| TEMP_FAILURE_RETRY (close (out_fd));
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c:1698: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'
# 1696| TEMP_FAILURE_RETRY (close (dev_null_fd));
# 1697| if (out_fd >= 0)
# 1698|-> TEMP_FAILURE_RETRY (close (out_fd));
# 1699| if (err_fd >= 0)
# 1700| TEMP_FAILURE_RETRY (close (err_fd));
Error: GCC_ANALYZER_WARNING (CWE-775):
crun-HEAD/src/libcrun/utils.c:1828: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'
# 1826| }
# 1827| return ret;
# 1828|-> }
# 1829|
# 1830| int
Error: GCC_ANALYZER_WARNING (CWE-775):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'run_process_with_stdin_timeout_envp'
crun-HEAD/src/libcrun/utils.c:1828: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'
# 1826| }
# 1827| return ret;
# 1828|-> }
# 1829|
# 1830| int
Error: GCC_ANALYZER_WARNING (CWE-476):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'find_executable'
crun-HEAD/src/libcrun/utils.c:2028: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.
# 2026|
# 2027| /* Absolute path. It doesn't need to lookup $PATH. */
# 2028|-> if (executable_path[0] == '/')
# 2029| {
# 2030| ret = check_access (executable_path);
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'copy_recursive_fd_to_fd'
crun-HEAD/src/libcrun/utils.c:2226:27: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcdirfd'
# 2224| if (UNLIKELY (dsrcfd == NULL))
# 2225| {
# 2226|-> TEMP_FAILURE_RETRY (close (srcdirfd));
# 2227| return crun_make_error (err, errno, "open directory `%s`", destname);
# 2228| }
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c:2270:31: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
# 2268| #endif
# 2269|
# 2270|-> TEMP_FAILURE_RETRY (close (destfd));
# 2271| destfd = -1;
# 2272| break;
Error: GCC_ANALYZER_WARNING (CWE-688):
crun-HEAD/src/libcrun/utils.c:2305: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
# 2303| return ret;
# 2304|
# 2305|-> ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2306| if (UNLIKELY (ret < 0))
# 2307| return crun_make_error (err, errno, "symlinkat `%s/%s`", destname, de->d_name);
Error: GCC_ANALYZER_WARNING (CWE-688):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'read_file_as_long_or_default'
crun-HEAD/src/libcrun/utils.c:2618: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
# 2616|
# 2617| errno = 0;
# 2618|-> val = strtol (content, &endptr, 10);
# 2619| if (UNLIKELY (errno))
# 2620| return def_value;
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c: scope_hint: In function 'libcrun_open_proc_file'
crun-HEAD/src/libcrun/utils.c:2919: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'
# 2917| /* requires closing if not cached */
# 2918| if (! container)
# 2919|-> TEMP_FAILURE_RETRY (close (proc_fd));
# 2920|
# 2921| if (UNLIKELY (fd < 0))
Error: GCC_ANALYZER_WARNING (CWE-1341):
crun-HEAD/src/libcrun/utils.c:2919: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'
# 2917| /* requires closing if not cached */
# 2918| if (! container)
# 2919|-> TEMP_FAILURE_RETRY (close (proc_fd));
# 2920|
# 2921| if (UNLIKELY (fd < 0))
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
crun-HEAD/src/libcrun/net_device.c:23: 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>'
crun-HEAD/src/libcrun/utils.h:24: included_from: Included from here.
crun-HEAD/src/libcrun/net_device.c: scope_hint: In function 'xrealloc'
crun-HEAD/src/libcrun/net_device.c:30: included_from: Included from here.
# 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):
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):
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):
crun-HEAD/src/libcrun/error.h:42: included_from: Included from here.
crun-HEAD/src/libcrun/linux.h:23: included_from: Included from here.
crun-HEAD/src/libcrun/intelrdt.c:22: 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):
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/seccomp.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):
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):
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):
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):
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):
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):
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):
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd'
crun-HEAD/src/libcrun/seccomp.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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '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/intelrdt.c:23: included_from: Included from here.
crun-HEAD/src/libcrun/linux.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):
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):
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):
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:660:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c:660: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):
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):
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):
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):
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):
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):
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):
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:660:12: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/cgroup-utils.c:660: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):
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):
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):
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'close_and_reset'
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):
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):
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):
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):
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):
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):
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):
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;