crun-1.21-1.fc43

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:29:26: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
#   27|           if (val != NULL)
#   28|             {
#   29|->             ret->first = YAJL_IS_TRUE(val);
#   30|               ret->first_present = 1;
#   31|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:46:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
#   44|         {
#   45|           yajl_val val = get_val (tree, "second", yajl_t_string);
#   46|->         if (val != NULL)
#   47|             {
#   48|               char *str = YAJL_GET_STRING (val);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:48:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_objectarrays_element(*<unknown>,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
#   46|           if (val != NULL)
#   47|             {
#   48|->             char *str = YAJL_GET_STRING (val);
#   49|               ret->second = strdup (str ? str : "");
#   50|               if (ret->second == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:50:16: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
#   48|               char *str = YAJL_GET_STRING (val);
#   49|               ret->second = strdup (str ? str : "");
#   50|->             if (ret->second == NULL)
#   51|                 return NULL;
#   52|             }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:142:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: return_function: returning to 'basic_test_double_array_parse_data' from 'make_basic_test_double_array'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:142:28: danger: 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/9)
#  140|         {
#  141|           yajl_val tmp = get_val (tree, "strarrays", yajl_t_array);
#  142|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#  143|             {
#  144|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:180:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: return_function: returning to 'basic_test_double_array_parse_data' from 'make_basic_test_double_array'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:180:28: danger: 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/9)
#  178|         {
#  179|           yajl_val tmp = get_val (tree, "intarrays", yajl_t_array);
#  180|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#  181|             {
#  182|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:328:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: return_function: returning to 'basic_test_double_array_parse_data' from 'make_basic_test_double_array'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:328:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/13)
#  326|       while (0);
#  327|   
#  328|->     if (tree->type == yajl_t_object)
#  329|         {
#  330|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:328:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: return_function: returning to 'basic_test_double_array_parse_data' from 'make_basic_test_double_array'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:328:9: danger: 'make_basic_test_double_array(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/9)
#  326|       while (0);
#  327|   
#  328|->     if (tree->type == yajl_t_object)
#  329|         {
#  330|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:395:29: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.strarrays_item_lens + i * 8'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:794:28: enter_function: entry to 'basic_test_double_array_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:800:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:803:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:808:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array.c:814:7: call_function: calling 'make_basic_test_double_array' from 'basic_test_double_array_parse_data'
#  393|             {
#  394|               size_t j;
#  395|->             for (j = 0; j < ptr->strarrays_item_lens[i]; j++)
#  396|                 {
#  397|                   free (ptr->strarrays[i][j]);

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_double_array_item_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:243:1: enter_function: entry to 'basic_test_double_array_item_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:248:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:251:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:253:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:258:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:258:7: call_function: calling 'basic_test_double_array_item_parse_data' from 'basic_test_double_array_item_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:258:7: return_function: returning to 'basic_test_double_array_item_parse_file_stream' from 'basic_test_double_array_item_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: danger: 'basic_test_double_array_item_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15)
#   61|           if (val != NULL)
#   62|             {
#   63|->             ret->item3 = YAJL_IS_TRUE(val);
#   64|               ret->item3_present = 1;
#   65|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:263:33: enter_function: entry to 'basic_test_double_array_item_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:269:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:272:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:277:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: call_function: calling 'make_basic_test_double_array_item' from 'basic_test_double_array_item_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: return_function: returning to 'basic_test_double_array_item_parse_data' from 'make_basic_test_double_array_item'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:63:26: danger: 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   61|           if (val != NULL)
#   62|             {
#   63|->             ret->item3 = YAJL_IS_TRUE(val);
#   64|               ret->item3_present = 1;
#   65|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:78:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:263:33: enter_function: entry to 'basic_test_double_array_item_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:269:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:272:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:277:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: call_function: calling 'make_basic_test_double_array_item' from 'basic_test_double_array_item_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:283:7: return_function: returning to 'basic_test_double_array_item_parse_data' from 'make_basic_test_double_array_item'
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:78:9: danger: 'make_basic_test_double_array_item(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#   76|       while (0);
#   77|   
#   78|->     if (tree->type == yajl_t_object)
#   79|         {
#   80|           size_t i;

Error: CPPCHECK_WARNING (CWE-401): [#def15]
crun-1.21/libocispec/src/ocispec/basic_test_double_array_item.c:214: error[memleak]: Memory leak: ret
#  212|           ret->item1 = strdup (src->item1);
#  213|           if (ret->item1 == NULL)
#  214|->           return NULL;
#  215|         }
#  216|       ret->item2 = src->item2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:20:10: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:153:39: enter_function: entry to 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:159:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:162:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:167:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: call_function: calling 'make_basic_test_top_array_int_container' from 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: return_function: returning to 'basic_test_top_array_int_container_parse_data' from 'make_basic_test_top_array_int_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:20:10: danger: 'make_basic_test_top_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:35:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:153:39: enter_function: entry to 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:159:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:162:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:167:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: call_function: calling 'make_basic_test_top_array_int_container' from 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:173:7: return_function: returning to 'basic_test_top_array_int_container_parse_data' from 'make_basic_test_top_array_int_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:35:17: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   33|   
#   34|   
#   35|->     for (i = 0; i < alen; i++)
#   36|         {
#   37|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:151:1: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:133:1: enter_function: entry to 'basic_test_top_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:138:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:141:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:143:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: call_function: calling 'basic_test_top_array_int_container_parse_data' from 'basic_test_top_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: return_function: returning to 'basic_test_top_array_int_container_parse_file_stream' from 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:155:90: call_function: inlined call to 'yajl_tree_free_function' from 'basic_test_top_array_int_container_parse_data'
#  149|   }
#  150|   
#  151|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  152|   
#  153|    basic_test_top_array_int_container * basic_test_top_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:159:9: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:133:1: enter_function: entry to 'basic_test_top_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:138:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:141:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:143:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: call_function: calling 'basic_test_top_array_int_container_parse_data' from 'basic_test_top_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:148:7: return_function: returning to 'basic_test_top_array_int_container_parse_file_stream' from 'basic_test_top_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_int.c:159:9: danger: 'basic_test_top_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(18)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/17)
#  157|       struct parser_context tmp_ctx = { 0 };
#  158|   
#  159|->     if (jsondata == NULL || err == NULL)
#  160|         return NULL;
#  161|   

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:152:9: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:126:1: enter_function: entry to 'basic_test_top_array_string_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:131:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:134:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:136:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:141:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:141:7: call_function: calling 'basic_test_top_array_string_container_parse_data' from 'basic_test_top_array_string_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:141:7: return_function: returning to 'basic_test_top_array_string_container_parse_file_stream' from 'basic_test_top_array_string_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_array_string.c:152:9: danger: 'basic_test_top_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(18)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/17)
#  150|       struct parser_context tmp_ctx = { 0 };
#  151|   
#  152|->     if (jsondata == NULL || err == NULL)
#  153|         return NULL;
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:20:10: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:176:46: enter_function: entry to 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:182:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:185:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:190:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: call_function: calling 'make_basic_test_top_double_array_int_container' from 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: return_function: returning to 'basic_test_top_double_array_int_container_parse_data' from 'make_basic_test_top_double_array_int_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:20:10: danger: 'make_basic_test_top_double_array_int_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:37:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:176:46: enter_function: entry to 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:182:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:185:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:190:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: call_function: calling 'make_basic_test_top_double_array_int_container' from 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:196:7: return_function: returning to 'basic_test_top_double_array_int_container_parse_data' from 'make_basic_test_top_double_array_int_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:37:17: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   35|         return NULL;
#   36|   
#   37|->     for (i = 0; i < alen; i++)
#   38|         {
#   39|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:174:1: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:156:1: enter_function: entry to 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:161:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:164:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:166:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: call_function: calling 'basic_test_top_double_array_int_container_parse_data' from 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: return_function: returning to 'basic_test_top_double_array_int_container_parse_file_stream' from 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:178:97: call_function: inlined call to 'yajl_tree_free_function' from 'basic_test_top_double_array_int_container_parse_data'
#  172|   }
#  173|   
#  174|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  175|   
#  176|    basic_test_top_double_array_int_container * basic_test_top_double_array_int_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:182:9: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:156:1: enter_function: entry to 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:161:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:164:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:166:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: call_function: calling 'basic_test_top_double_array_int_container_parse_data' from 'basic_test_top_double_array_int_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:171:7: return_function: returning to 'basic_test_top_double_array_int_container_parse_file_stream' from 'basic_test_top_double_array_int_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_int.c:182:9: danger: 'basic_test_top_double_array_int_container_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(18)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/17)
#  180|       struct parser_context tmp_ctx = { 0 };
#  181|   
#  182|->     if (jsondata == NULL || err == NULL)
#  183|         return NULL;
#  184|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:29:26: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_obj_element(*<unknown>,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:319:46: enter_function: entry to 'basic_test_top_double_array_obj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:325:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:328:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:333:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: call_function: calling 'make_basic_test_top_double_array_obj_container' from 'basic_test_top_double_array_obj_container_parse_data'
#   27|           if (val != NULL)
#   28|             {
#   29|->             ret->first = YAJL_IS_TRUE(val);
#   30|               ret->first_present = 1;
#   31|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:68:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_obj_element(*<unknown>,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:319:46: enter_function: entry to 'basic_test_top_double_array_obj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:325:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:328:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:333:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: call_function: calling 'make_basic_test_top_double_array_obj_container' from 'basic_test_top_double_array_obj_container_parse_data'
#   66|         {
#   67|           yajl_val val = get_val (tree, "third", yajl_t_string);
#   68|->         if (val != NULL)
#   69|             {
#   70|               char *str = YAJL_GET_STRING (val);

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

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def34]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:220:27: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:319:46: enter_function: entry to 'basic_test_top_double_array_obj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:325:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:328:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:333:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: call_function: calling 'make_basic_test_top_double_array_obj_container' from 'basic_test_top_double_array_obj_container_parse_data'
#  218|         {
#  219|             size_t j;
#  220|->           for (j = 0; j < ptr->subitem_lens[i]; j++)
#  221|               {
#  222|                 free_basic_test_top_double_array_obj_element (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:222:15: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:319:46: enter_function: entry to 'basic_test_top_double_array_obj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:325:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:328:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:333:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_obj.c:339:7: call_function: calling 'make_basic_test_top_double_array_obj_container' from 'basic_test_top_double_array_obj_container_parse_data'
#  220|             for (j = 0; j < ptr->subitem_lens[i]; j++)
#  221|               {
#  222|->               free_basic_test_top_double_array_obj_element (ptr->items[i][j]);
#  223|                 ptr->items[i][j] = NULL;
#  224|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:10: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_refobj_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:148:1: enter_function: entry to 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:153:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:156:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:158:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: call_function: calling 'basic_test_top_double_array_refobj_container_parse_data' from 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: return_function: returning to 'basic_test_top_double_array_refobj_container_parse_file_stream' from 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:10: danger: 'basic_test_top_double_array_refobj_container_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:10: warning[-Wanalyzer-malloc-leak]: leak of 'make_basic_test_top_double_array_refobj_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:168:49: enter_function: entry to 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:174:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:177:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:182:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: call_function: calling 'make_basic_test_top_double_array_refobj_container' from 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: return_function: returning to 'basic_test_top_double_array_refobj_container_parse_data' from 'make_basic_test_top_double_array_refobj_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:20:10: danger: 'make_basic_test_top_double_array_refobj_container(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#   18|       size_t i, alen;
#   19|        (void) ctx;
#   20|->      if (tree == NULL || err == NULL || YAJL_GET_ARRAY (tree) == NULL)
#   21|         return NULL;
#   22|       *err = NULL;

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:37:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:168:49: enter_function: entry to 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:174:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:177:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:182:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: call_function: calling 'make_basic_test_top_double_array_refobj_container' from 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: return_function: returning to 'basic_test_top_double_array_refobj_container_parse_data' from 'make_basic_test_top_double_array_refobj_container'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:37:17: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/13)
#   35|         return NULL;
#   36|   
#   37|->     for (i = 0; i < alen; i++)
#   38|         {
#   39|           yajl_val work = YAJL_GET_ARRAY_NO_CHECK (tree)->values[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:69:27: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:168:49: enter_function: entry to 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:174:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:177:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:182:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:188:7: call_function: calling 'make_basic_test_top_double_array_refobj_container' from 'basic_test_top_double_array_refobj_container_parse_data'
#   67|         {
#   68|             size_t j;
#   69|->           for (j = 0; j < ptr->subitem_lens[i]; j++)
#   70|               {
#   71|                 free_basic_test_double_array_item (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:166:1: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:148:1: enter_function: entry to 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:153:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:156:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:158:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: call_function: calling 'basic_test_top_double_array_refobj_container_parse_data' from 'basic_test_top_double_array_refobj_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:163:7: return_function: returning to 'basic_test_top_double_array_refobj_container_parse_file_stream' from 'basic_test_top_double_array_refobj_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_refobj.c:170:100: call_function: inlined call to 'yajl_tree_free_function' from 'basic_test_top_double_array_refobj_container_parse_data'
#  164|   }
#  165|   
#  166|-> define_cleaner_function (yajl_val, yajl_tree_free)
#  167|   
#  168|    basic_test_top_double_array_refobj_container * basic_test_top_double_array_refobj_container_parse_data (const char *jsondata, const struct parser_context *ctx, parser_error *err)

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

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:74:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '*ptr.subitem_lens + i * 8'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:173:49: enter_function: entry to 'basic_test_top_double_array_string_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:179:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:182:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:187:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:193:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:193:7: call_function: calling 'make_basic_test_top_double_array_string_container' from 'basic_test_top_double_array_string_container_parse_data'
#   72|         {
#   73|           size_t j;
#   74|->         for (j = 0; j < ptr->subitem_lens[i]; j++)
#   75|             {
#   76|               free (ptr->items[i][j]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:76:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '*<unknown> + j * 8'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:173:49: enter_function: entry to 'basic_test_top_double_array_string_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:179:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:182:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:187:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:193:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:193:7: call_function: calling 'make_basic_test_top_double_array_string_container' from 'basic_test_top_double_array_string_container_parse_data'
#   74|           for (j = 0; j < ptr->subitem_lens[i]; j++)
#   75|             {
#   76|->             free (ptr->items[i][j]);
#   77|               ptr->items[i][j] = NULL;
#   78|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:179:9: warning[-Wanalyzer-malloc-leak]: leak of 'basic_test_top_double_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:153:1: enter_function: entry to 'basic_test_top_double_array_string_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:158:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:161:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:163:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:168:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:168:7: call_function: calling 'basic_test_top_double_array_string_container_parse_data' from 'basic_test_top_double_array_string_container_parse_file_stream'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:168:7: return_function: returning to 'basic_test_top_double_array_string_container_parse_file_stream' from 'basic_test_top_double_array_string_container_parse_data'
crun-1.21/libocispec/src/ocispec/basic_test_top_double_array_string.c:179:9: danger: 'basic_test_top_double_array_string_container_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(18)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/17)
#  177|       struct parser_context tmp_ctx = { 0 };
#  178|   
#  179|->     if (jsondata == NULL || err == NULL)
#  180|         return NULL;
#  181|   

Error: CPPCHECK_WARNING (CWE-401): [#def48]
crun-1.21/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): [#def49]
crun-1.21/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): [#def50]
crun-1.21/libocispec/src/ocispec/image_manifest_items_image_manifest_items_schema.c:318: error[memleak]: Memory leak: ptr
#  316|       ptr->items = calloc (alen + 1, sizeof(*ptr->items));
#  317|       if (ptr->items == NULL)
#  318|->       return NULL;
#  319|       ptr->len = alen;
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:42:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_config(get_val(tree, "config", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#   40|         {
#   41|           yajl_val tmp = get_val (tree, "Env", yajl_t_array);
#   42|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   43|             {
#   44|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:68:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_config(get_val(tree, "config", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#   66|         {
#   67|           yajl_val tmp = get_val (tree, "Entrypoint", yajl_t_array);
#   68|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   69|             {
#   70|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:167:33: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_config(get_val(tree, "config", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  165|           if (val != NULL)
#  166|             {
#  167|->             ret->args_escaped = YAJL_IS_TRUE(val);
#  168|               ret->args_escaped_present = 1;
#  169|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:182:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  180|       while (0);
#  181|   
#  182|->     if (tree->type == yajl_t_object)
#  183|         {
#  184|           size_t i;

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:855:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  853|           if (val != NULL)
#  854|             {
#  855|->             char *str = YAJL_GET_STRING (val);
#  856|               ret->created = strdup (str ? str : "");
#  857|               if (ret->created == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:867:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  865|           if (val != NULL)
#  866|             {
#  867|->             char *str = YAJL_GET_STRING (val);
#  868|               ret->author = strdup (str ? str : "");
#  869|               if (ret->author == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:879:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  877|           if (val != NULL)
#  878|             {
#  879|->             char *str = YAJL_GET_STRING (val);
#  880|               ret->created_by = strdup (str ? str : "");
#  881|               if (ret->created_by == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:903:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_config_schema_history_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  901|           if (val != NULL)
#  902|             {
#  903|->             ret->empty_layer = YAJL_IS_TRUE(val);
#  904|               ret->empty_layer_present = 1;
#  905|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:904:13: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1615:36: enter_function: entry to 'image_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1621:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1624:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1629:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_config_schema.c:1635:7: call_function: calling 'make_image_spec_schema_config_schema' from 'image_spec_schema_config_schema_parse_data'
#  902|             {
#  903|               ret->empty_layer = YAJL_IS_TRUE(val);
#  904|->             ret->empty_layer_present = 1;
#  905|             }
#  906|           else

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

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

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

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

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_content_descriptor(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:454:41: enter_function: entry to 'image_spec_schema_content_descriptor_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:460:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:463:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:468:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: call_function: calling 'make_image_spec_schema_content_descriptor' from 'image_spec_schema_content_descriptor_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: return_function: returning to 'image_spec_schema_content_descriptor_parse_data' from 'make_image_spec_schema_content_descriptor'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:29:25: danger: 'make_image_spec_schema_content_descriptor(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   27|           if (val != NULL)
#   28|             {
#   29|->             char *str = YAJL_GET_STRING (val);
#   30|               ret->media_type = strdup (str ? str : "");
#   31|               if (ret->media_type == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:151:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:454:41: enter_function: entry to 'image_spec_schema_content_descriptor_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:460:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:463:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:468:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: call_function: calling 'make_image_spec_schema_content_descriptor' from 'image_spec_schema_content_descriptor_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:474:7: return_function: returning to 'image_spec_schema_content_descriptor_parse_data' from 'make_image_spec_schema_content_descriptor'
crun-1.21/libocispec/src/ocispec/image_spec_schema_content_descriptor.c:151:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  149|         }
#  150|   
#  151|->     if (tree->type == yajl_t_object)
#  152|         {
#  153|           size_t i;

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def81]
crun-1.21/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): [#def82]
crun-1.21/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): [#def83]
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:126:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:67:1: enter_function: entry to 'make_image_spec_schema_defs_map_string_object'
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:72:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:74:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:75:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:77:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:77:9: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:80:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:84:21: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:85:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:87:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:88:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_defs.c:69:109: call_function: inlined call to 'free_image_spec_schema_defs_map_string_object_function' from 'make_image_spec_schema_defs_map_string_object'
#  124|           ptr->values = NULL;
#  125|         }
#  126|->     free (ptr);
#  127|   }
#  128|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:29:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_index_schema_manifests_platform(get_val(tree, "platform", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1027:41: enter_function: entry to 'image_spec_schema_image_index_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1033:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1036:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1041:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1047:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1047:7: call_function: calling 'make_image_spec_schema_image_index_schema' from 'image_spec_schema_image_index_schema_parse_data'
#   27|           if (val != NULL)
#   28|             {
#   29|->             char *str = YAJL_GET_STRING (val);
#   30|               ret->architecture = strdup (str ? str : "");
#   31|               if (ret->architecture == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:111:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1027:41: enter_function: entry to 'image_spec_schema_image_index_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1033:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1036:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1041:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1047:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_index_schema.c:1047:7: call_function: calling 'make_image_spec_schema_image_index_schema' from 'image_spec_schema_image_index_schema_parse_data'
#  109|         }
#  110|   
#  111|->     if (tree->type == yajl_t_object)
#  112|         {
#  113|           size_t i;

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

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

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

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

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_layout_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:197:42: enter_function: entry to 'image_spec_schema_image_layout_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:203:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:206:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:211:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: call_function: calling 'make_image_spec_schema_image_layout_schema' from 'image_spec_schema_image_layout_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: return_function: returning to 'image_spec_schema_image_layout_schema_parse_data' from 'make_image_spec_schema_image_layout_schema'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:29:25: danger: 'make_image_spec_schema_image_layout_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   27|           if (val != NULL)
#   28|             {
#   29|->             char *str = YAJL_GET_STRING (val);
#   30|               ret->image_layout_version = strdup (str ? str : "");
#   31|               if (ret->image_layout_version == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:197:42: enter_function: entry to 'image_spec_schema_image_layout_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:203:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:206:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:211:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: call_function: calling 'make_image_spec_schema_image_layout_schema' from 'image_spec_schema_image_layout_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:217:7: return_function: returning to 'image_spec_schema_image_layout_schema_parse_data' from 'make_image_spec_schema_image_layout_schema'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_layout_schema.c:43:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   41|         }
#   42|   
#   43|->     if (tree->type == yajl_t_object)
#   44|         {
#   45|           size_t i;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: warning[-Wanalyzer-malloc-leak]: leak of 'image_spec_schema_image_manifest_schema_parse_data(fread_file(stream, & filesize), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:408:1: enter_function: entry to 'image_spec_schema_image_manifest_schema_parse_file_stream'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:413:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:416:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:418:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:423:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:423:7: call_function: calling 'image_spec_schema_image_manifest_schema_parse_data' from 'image_spec_schema_image_manifest_schema_parse_file_stream'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:423:7: return_function: returning to 'image_spec_schema_image_manifest_schema_parse_file_stream' from 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: danger: 'image_spec_schema_image_manifest_schema_parse_data(fread_file(stream, & filesize), ctx,  err)' leaks here; was allocated at [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15)
#   77|         {
#   78|           yajl_val tmp = get_val (tree, "layers", yajl_t_array);
#   79|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   80|             {
#   81|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_image_spec_schema_image_manifest_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:428:44: enter_function: entry to 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:434:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:437:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:442:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: call_function: calling 'make_image_spec_schema_image_manifest_schema' from 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: return_function: returning to 'image_spec_schema_image_manifest_schema_parse_data' from 'make_image_spec_schema_image_manifest_schema'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:79:28: danger: 'make_image_spec_schema_image_manifest_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   77|         {
#   78|           yajl_val tmp = get_val (tree, "layers", yajl_t_array);
#   79|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   80|             {
#   81|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:129:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:428:44: enter_function: entry to 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:434:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:437:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:442:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: call_function: calling 'make_image_spec_schema_image_manifest_schema' from 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: return_function: returning to 'image_spec_schema_image_manifest_schema_parse_data' from 'make_image_spec_schema_image_manifest_schema'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:129:8: danger: '<unknown>' leaks here; was allocated at [(20)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/19)
#  127|         }
#  128|   
#  129|->     if (tree->type == yajl_t_object)
#  130|         {
#  131|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:428:44: enter_function: entry to 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:434:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:437:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:442:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: call_function: calling 'make_image_spec_schema_image_manifest_schema' from 'image_spec_schema_image_manifest_schema_parse_data'
#  179|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  180|   
#  181|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  182|             ret->_residual = resi;
#  183|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:181:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:428:44: enter_function: entry to 'image_spec_schema_image_manifest_schema_parse_data'
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:434:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:437:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:442:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/image_spec_schema_image_manifest_schema.c:448:7: call_function: calling 'make_image_spec_schema_image_manifest_schema' from 'image_spec_schema_image_manifest_schema_parse_data'
#  179|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  180|   
#  181|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  182|             ret->_residual = resi;
#  183|         }

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

Error: CPPCHECK_WARNING (CWE-401): [#def106]
crun-1.21/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): [#def107]
crun-1.21/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): [#def108]
crun-1.21/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): [#def109]
crun-1.21/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): [#def110]
crun-1.21/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): [#def111]
crun-1.21/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): [#def112]
crun-1.21/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): [#def113]
crun-1.21/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): [#def114]
crun-1.21/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): [#def115]
crun-1.21/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): [#def116]
crun-1.21/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): [#def117]
crun-1.21/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): [#def118]
crun-1.21/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): [#def119]
crun-1.21/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): [#def120]
crun-1.21/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): [#def121]
crun-1.21/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): [#def122]
crun-1.21/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): [#def123]
crun-1.21/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): [#def124]
crun-1.21/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): [#def125]
crun-1.21/libocispec/src/ocispec/json_common.c:1479:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.keys + i * 8'
crun-1.21/libocispec/src/ocispec/json_common.c:1569:1: enter_function: entry to 'clone_map_string_string'
crun-1.21/libocispec/src/ocispec/json_common.c:1574:6: branch_false: following 'false' branch (when 'src' is non-NULL)...
crun-1.21/libocispec/src/ocispec/json_common.c:1577:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1578:6: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/json_common.c:1581:14: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1583:15: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/json_common.c:1584:6: release_memory: assuming '<unknown>' is NULL
crun-1.21/libocispec/src/ocispec/json_common.c:1584:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1571:72: call_function: inlined call to 'free_json_map_string_string_function' from 'clone_map_string_string'
# 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): [#def126]
crun-1.21/libocispec/src/ocispec/json_common.c:1481:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '*map.values + i * 8'
crun-1.21/libocispec/src/ocispec/json_common.c:1569:1: enter_function: entry to 'clone_map_string_string'
crun-1.21/libocispec/src/ocispec/json_common.c:1574:6: branch_false: following 'false' branch (when 'src' is non-NULL)...
crun-1.21/libocispec/src/ocispec/json_common.c:1577:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1578:6: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/json_common.c:1581:14: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1584:6: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/json_common.c:1587:17: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1587:17: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/json_common.c:1588:6: release_memory: assuming '<unknown>' is NULL
crun-1.21/libocispec/src/ocispec/json_common.c:1588:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/libocispec/src/ocispec/json_common.c:1571:72: call_function: inlined call to 'free_json_map_string_string_function' from 'clone_map_string_string'
# 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): [#def127]
crun-1.21/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): [#def128]
crun-1.21/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): [#def129]
crun-1.21/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): [#def130]
crun-1.21/libocispec/src/ocispec/json_common.c:1589: error[memleak]: Memory leak: ret
# 1587|     ret->values = calloc (src->len + 1, sizeof (char *));
# 1588|     if (ret->values == NULL)
# 1589|->     return NULL;
# 1590|   
# 1591|     for (i = 0; i < src->len; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:47:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_pids(get_val(tree, "pids", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3310:1: enter_function: entry to 'make_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3315:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3317:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3318:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3322:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3408:22: call_function: calling 'make_runtime_spec_schema_config_linux_resources' from 'make_runtime_spec_schema_config_linux'
#   45|       while (0);
#   46|   
#   47|->     if (tree->type == yajl_t_object)
#   48|         {
#   49|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:214:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3310:1: enter_function: entry to 'make_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3315:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3317:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3318:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3322:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3408:22: call_function: calling 'make_runtime_spec_schema_config_linux_resources' from 'make_runtime_spec_schema_config_linux'
#  212|         {
#  213|           yajl_val tmp = get_val (tree, "throttleReadBpsDevice", yajl_t_array);
#  214|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#  215|             {
#  216|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:236:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3310:1: enter_function: entry to 'make_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3315:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3317:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3318:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3322:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3408:22: call_function: calling 'make_runtime_spec_schema_config_linux_resources' from 'make_runtime_spec_schema_config_linux'
#  234|         {
#  235|           yajl_val tmp = get_val (tree, "throttleWriteBpsDevice", yajl_t_array);
#  236|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#  237|             {
#  238|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:322:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3310:1: enter_function: entry to 'make_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3315:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3317:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3318:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3322:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3408:22: call_function: calling 'make_runtime_spec_schema_config_linux_resources' from 'make_runtime_spec_schema_config_linux'
#  320|       while (0);
#  321|   
#  322|->     if (tree->type == yajl_t_object)
#  323|         {
#  324|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:322:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_resources_block_io(get_val(tree, "blockIO", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3310:1: enter_function: entry to 'make_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3315:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3317:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3318:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3322:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3408:22: call_function: calling 'make_runtime_spec_schema_config_linux_resources' from 'make_runtime_spec_schema_config_linux'
#  320|       while (0);
#  321|   
#  322|->     if (tree->type == yajl_t_object)
#  323|         {
#  324|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:633:19: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_block_io(*src.block_io)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
#  631|       if (ret == NULL)
#  632|         return NULL;
#  633|->     ret->weight = src->weight;
#  634|       ret->weight_present = src->weight_present;
#  635|       ret->leaf_weight = src->leaf_weight;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:689:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
#  687|             }
#  688|         }
#  689|->     if (src->weight_device)
#  690|         {
#  691|           ret->weight_device_len = src->weight_device_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1107:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_cpu(*src.cpu)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
# 1105|       if (ret == NULL)
# 1106|         return NULL;
# 1107|->     if (src->cpus)
# 1108|         {
# 1109|           ret->cpus = strdup (src->cpus);

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1132:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
# 1130|       ret->shares_present = src->shares_present;
# 1131|       ret->idle = src->idle;
# 1132|->     ret->idle_present = src->idle_present;
# 1133|       return move_ptr (ret);
# 1134|   }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1891:21: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources_network(*src.network)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
# 1889|       if (ret == NULL)
# 1890|         return NULL;
# 1891|->     ret->class_id = src->class_id;
# 1892|       ret->class_id_present = src->class_id_present;
# 1893|       if (src->priorities)

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:1899:28: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
# 1897|           if (ret->priorities == NULL)
# 1898|             return NULL;
# 1899|->         for (size_t i = 0; i < src->priorities_len; i++)
# 1900|             {
# 1901|               ret->priorities[i] = clone_runtime_spec_schema_defs_linux_network_interface_priority (src->priorities[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2325:20: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_resources(*src.resources)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2325:20: danger: 'clone_runtime_spec_schema_config_linux_resources(*src.resources)' leaks here; was allocated at [(16)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/15)
# 2323|       if (ret == NULL)
# 2324|         return NULL;
# 2325|->     ret->unified = clone_map_string_string (src->unified);
# 2326|       if (ret->unified == NULL)
# 2327|           return NULL;

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2384:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: call_function: calling 'clone_runtime_spec_schema_config_linux_resources' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4042:26: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2384:8: danger: '<unknown>' leaks here; was allocated at [(22)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/21)
# 2382|             return NULL;
# 2383|         }
# 2384|->     if (src->rdma)
# 2385|         {
# 2386|           ret->rdma = clone_runtime_spec_schema_config_linux_resources_rdma (src->rdma);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2811:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_seccomp(*src.seccomp)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: call_function: calling 'clone_runtime_spec_schema_config_linux_seccomp' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_seccomp'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2811:9: danger: 'clone_runtime_spec_schema_config_linux_seccomp(*src.seccomp)' leaks here; was allocated at [(22)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/21)
# 2809|       if (ret == NULL)
# 2810|         return NULL;
# 2811|->     if (src->default_action)
# 2812|         {
# 2813|           ret->default_action = strdup (src->default_action);

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2863:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: call_function: calling 'clone_runtime_spec_schema_config_linux_seccomp' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4060:24: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_seccomp'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:2863:8: danger: '<unknown>' leaks here; was allocated at [(26)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/25)
# 2861|             }
# 2862|         }
# 2863|->     if (src->syscalls)
# 2864|         {
# 2865|           ret->syscalls_len = src->syscalls_len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3129:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_intel_rdt(*src.intel_rdt)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4064:19: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4065:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: call_function: calling 'clone_runtime_spec_schema_config_linux_intel_rdt' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_intel_rdt'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3129:9: danger: 'clone_runtime_spec_schema_config_linux_intel_rdt(*src.intel_rdt)' leaks here; was allocated at [(32)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/31)
# 3127|       if (ret == NULL)
# 3128|         return NULL;
# 3129|->     if (src->clos_id)
# 3130|         {
# 3131|           ret->clos_id = strdup (src->clos_id);

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3150:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4064:19: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4065:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: call_function: calling 'clone_runtime_spec_schema_config_linux_intel_rdt' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4107:26: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_intel_rdt'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3150:5: danger: '<unknown>' leaks here; was allocated at [(36)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/35)
# 3148|       ret->enable_cmt_present = src->enable_cmt_present;
# 3149|       ret->enable_mbm = src->enable_mbm;
# 3150|->     ret->enable_mbm_present = src->enable_mbm_present;
# 3151|       return move_ptr (ret);
# 3152|   }

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3293:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_linux_time_offsets(*src.time_offsets)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3981:1: enter_function: entry to 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3988:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4001:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4014:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4027:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4040:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4046:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4052:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4058:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4064:19: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4065:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4067:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4083:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4099:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4105:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4111:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4111:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4117:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4117:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4119:29: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4119:29: call_function: calling 'clone_runtime_spec_schema_config_linux_time_offsets' from 'clone_runtime_spec_schema_config_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:4119:29: return_function: returning to 'clone_runtime_spec_schema_config_linux' from 'clone_runtime_spec_schema_config_linux_time_offsets'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3293:9: danger: 'clone_runtime_spec_schema_config_linux_time_offsets(*src.time_offsets)' leaks here; was allocated at [(36)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/35)
# 3291|       if (ret == NULL)
# 3292|         return NULL;
# 3293|->     if (src->boottime)
# 3294|         {
# 3295|           ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def169]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:27:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#   25|         {
#   26|           yajl_val tmp = get_val (tree, "prestart", yajl_t_array);
#   27|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   28|             {
#   29|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def170]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:49:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#   47|         {
#   48|           yajl_val tmp = get_val (tree, "createRuntime", yajl_t_array);
#   49|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   50|             {
#   51|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:71:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#   69|         {
#   70|           yajl_val tmp = get_val (tree, "createContainer", yajl_t_array);
#   71|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
#   72|             {
#   73|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:157:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#  155|       while (0);
#  156|   
#  157|->     if (tree->type == yajl_t_object)
#  158|         {
#  159|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:157:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_hooks(get_val(tree, "hooks", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#  155|       while (0);
#  156|   
#  157|->     if (tree->type == yajl_t_object)
#  158|         {
#  159|           size_t i;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:579:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_root(get_val(tree, "root", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#  577|           if (val != NULL)
#  578|             {
#  579|->             char *str = YAJL_GET_STRING (val);
#  580|               ret->path = strdup (str ? str : "");
#  581|               if (ret->path == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:612:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#  610|         }
#  611|   
#  612|->     if (tree->type == yajl_t_object)
#  613|         {
#  614|           size_t i;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_console_size(get_val(tree, "consoleSize", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
#  797|       while (0);
#  798|   
#  799|->     if (tree->type == yajl_t_object)
#  800|         {
#  801|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1003:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1001|         {
# 1002|           yajl_val tmp = get_val (tree, "additionalGids", yajl_t_array);
# 1003|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
# 1004|             {
# 1005|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1048:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1046|       while (0);
# 1047|   
# 1048|->     if (tree->type == yajl_t_object)
# 1049|         {
# 1050|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1048:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_user(get_val(tree, "user", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1046|       while (0);
# 1047|   
# 1048|->     if (tree->type == yajl_t_object)
# 1049|         {
# 1050|           size_t i;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1263:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1261|         {
# 1262|           yajl_val tmp = get_val (tree, "bounding", yajl_t_array);
# 1263|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
# 1264|             {
# 1265|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1289:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1287|         {
# 1288|           yajl_val tmp = get_val (tree, "permitted", yajl_t_array);
# 1289|->         if (tmp != NULL && YAJL_GET_ARRAY (tmp) != NULL)
# 1290|             {
# 1291|               size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1391:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1389|       while (0);
# 1390|   
# 1391|->     if (tree->type == yajl_t_object)
# 1392|         {
# 1393|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:1391:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_schema_process_capabilities(get_val(tree, "capabilities", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3972:38: enter_function: entry to 'runtime_spec_schema_config_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3978:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3981:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3986:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3992:7: call_function: calling 'make_runtime_spec_schema_config_schema' from 'runtime_spec_schema_config_schema_parse_data'
# 1389|       while (0);
# 1390|   
# 1391|->     if (tree->type == yajl_t_object)
# 1392|         {
# 1393|           size_t i;

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

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

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

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

Error: CPPCHECK_WARNING (CWE-401): [#def192]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2678: error[memleak]: Memory leak: ret
# 2676|           ret->initial = strdup (src->initial);
# 2677|           if (ret->initial == NULL)
# 2678|->           return NULL;
# 2679|         }
# 2680|       if (src->final)

Error: CPPCHECK_WARNING (CWE-401): [#def193]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:2684: error[memleak]: Memory leak: ret
# 2682|           ret->final = strdup (src->final);
# 2683|           if (ret->final == NULL)
# 2684|->           return NULL;
# 2685|         }
# 2686|       return move_ptr (ret);

Error: CPPCHECK_WARNING (CWE-401): [#def194]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3313: error[memleak]: Memory leak: ret
# 3311|           ret->args = calloc (src->args_len + 1, sizeof (*ret->args));
# 3312|           if (ret->args == NULL)
# 3313|->           return NULL;
# 3314|           for (size_t i = 0; i < src->args_len; i++)
# 3315|             {

Error: CPPCHECK_WARNING (CWE-401): [#def195]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3851: error[memleak]: Memory leak: ret
# 3849|           ret->oci_version = strdup (src->oci_version);
# 3850|           if (ret->oci_version == NULL)
# 3851|->           return NULL;
# 3852|         }
# 3853|       if (src->hooks)

Error: CPPCHECK_WARNING (CWE-401): [#def196]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3857: error[memleak]: Memory leak: ret
# 3855|           ret->hooks = clone_runtime_spec_schema_config_schema_hooks (src->hooks);
# 3856|           if (ret->hooks == NULL)
# 3857|->           return NULL;
# 3858|         }
# 3859|       ret->annotations = clone_map_string_string (src->annotations);

Error: CPPCHECK_WARNING (CWE-401): [#def197]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3861: error[memleak]: Memory leak: ret
# 3859|       ret->annotations = clone_map_string_string (src->annotations);
# 3860|       if (ret->annotations == NULL)
# 3861|->         return NULL;
# 3862|       if (src->hostname)
# 3863|         {

Error: CPPCHECK_WARNING (CWE-401): [#def198]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3866: error[memleak]: Memory leak: ret
# 3864|           ret->hostname = strdup (src->hostname);
# 3865|           if (ret->hostname == NULL)
# 3866|->           return NULL;
# 3867|         }
# 3868|       if (src->domainname)

Error: CPPCHECK_WARNING (CWE-401): [#def199]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3872: error[memleak]: Memory leak: ret
# 3870|           ret->domainname = strdup (src->domainname);
# 3871|           if (ret->domainname == NULL)
# 3872|->           return NULL;
# 3873|         }
# 3874|       if (src->mounts)

Error: CPPCHECK_WARNING (CWE-401): [#def200]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_schema.c:3879: error[memleak]: Memory leak: ret
# 3877|           ret->mounts = calloc (src->mounts_len + 1, sizeof (*ret->mounts));
# 3878|           if (ret->mounts == NULL)
# 3879|->           return NULL;
# 3880|           for (size_t i = 0; i < src->mounts_len; i++)
# 3881|             {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:37:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_cpu(get_val(tree, "cappedCPU", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: call_function: calling 'make_runtime_spec_schema_config_solaris_capped_cpu' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_capped_cpu'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:37:9: danger: 'make_runtime_spec_schema_config_solaris_capped_cpu(get_val(tree, "cappedCPU", 3), ctx,  err)' leaks here; was allocated at [(16)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/15)
#   35|       while (0);
#   36|   
#   37|->     if (tree->type == yajl_t_object)
#   38|         {
#   39|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:142:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_solaris_capped_cpu(*src.capped_cpu)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:870:1: enter_function: entry to 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:875:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: call_function: calling 'clone_runtime_spec_schema_config_solaris_capped_cpu' from 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: return_function: returning to 'clone_runtime_spec_schema_config_solaris' from 'clone_runtime_spec_schema_config_solaris_capped_cpu'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:142:9: danger: 'clone_runtime_spec_schema_config_solaris_capped_cpu(*src.capped_cpu)' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  140|       if (ret == NULL)
#  141|         return NULL;
#  142|->     if (src->ncpus)
#  143|         {
#  144|           ret->ncpus = strdup (src->ncpus);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:145:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:870:1: enter_function: entry to 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:875:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: call_function: calling 'clone_runtime_spec_schema_config_solaris_capped_cpu' from 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:897:27: return_function: returning to 'clone_runtime_spec_schema_config_solaris' from 'clone_runtime_spec_schema_config_solaris_capped_cpu'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:145:12: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/17)
#  143|         {
#  144|           ret->ncpus = strdup (src->ncpus);
#  145|->         if (ret->ncpus == NULL)
#  146|             return NULL;
#  147|         }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: call_function: calling 'make_runtime_spec_schema_config_solaris_capped_memory' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:168:25: danger: 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)' leaks here; was allocated at [(20)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/19)
#  166|           if (val != NULL)
#  167|             {
#  168|->             char *str = YAJL_GET_STRING (val);
#  169|               ret->physical = strdup (str ? str : "");
#  170|               if (ret->physical == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:180:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: call_function: calling 'make_runtime_spec_schema_config_solaris_capped_memory' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:180:25: danger: 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)' leaks here; was allocated at [(20)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/19)
#  178|           if (val != NULL)
#  179|             {
#  180|->             char *str = YAJL_GET_STRING (val);
#  181|               ret->swap = strdup (str ? str : "");
#  182|               if (ret->swap == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: call_function: calling 'make_runtime_spec_schema_config_solaris_capped_memory' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:8: danger: '<unknown>' leaks here; was allocated at [(24)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/23)
#  186|       while (0);
#  187|   
#  188|->     if (tree->type == yajl_t_object)
#  189|         {
#  190|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: call_function: calling 'make_runtime_spec_schema_config_solaris_capped_memory' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:188:9: danger: 'make_runtime_spec_schema_config_solaris_capped_memory(get_val(tree, "cappedMemory", 3), ctx,  err)' leaks here; was allocated at [(20)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/19)
#  186|       while (0);
#  187|   
#  188|->     if (tree->type == yajl_t_object)
#  189|         {
#  190|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:308:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_solaris_capped_memory(*src.capped_memory)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:870:1: enter_function: entry to 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:875:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: call_function: calling 'clone_runtime_spec_schema_config_solaris_capped_memory' from 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: return_function: returning to 'clone_runtime_spec_schema_config_solaris' from 'clone_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:308:9: danger: 'clone_runtime_spec_schema_config_solaris_capped_memory(*src.capped_memory)' leaks here; was allocated at [(16)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/15)
#  306|       if (ret == NULL)
#  307|         return NULL;
#  308|->     if (src->physical)
#  309|         {
#  310|           ret->physical = strdup (src->physical);

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:314:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:870:1: enter_function: entry to 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:875:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: call_function: calling 'clone_runtime_spec_schema_config_solaris_capped_memory' from 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: return_function: returning to 'clone_runtime_spec_schema_config_solaris' from 'clone_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:314:8: danger: '<unknown>' leaks here; was allocated at [(20)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/19)
#  312|             return NULL;
#  313|         }
#  314|->     if (src->swap)
#  315|         {
#  316|           ret->swap = strdup (src->swap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:317:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:870:1: enter_function: entry to 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:875:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:877:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:883:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:889:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:895:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:901:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: call_function: calling 'clone_runtime_spec_schema_config_solaris_capped_memory' from 'clone_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:903:30: return_function: returning to 'clone_runtime_spec_schema_config_solaris' from 'clone_runtime_spec_schema_config_solaris_capped_memory'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:317:12: danger: '<unknown>' leaks here; was allocated at [(22)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/21)
#  315|         {
#  316|           ret->swap = strdup (src->swap);
#  317|->         if (ret->swap == NULL)
#  318|             return NULL;
#  319|         }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:39: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:652:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:653:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:660:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:662:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:664:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: call_function: calling 'make_runtime_spec_schema_config_solaris_anet_element' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_anet_element'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:340:25: danger: 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)' leaks here; was allocated at [(30)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/29)
#  338|           if (val != NULL)
#  339|             {
#  340|->             char *str = YAJL_GET_STRING (val);
#  341|               ret->linkname = strdup (str ? str : "");
#  342|               if (ret->linkname == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:352:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:39: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:652:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:653:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:660:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:662:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:664:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: call_function: calling 'make_runtime_spec_schema_config_solaris_anet_element' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_anet_element'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:352:25: danger: 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)' leaks here; was allocated at [(30)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/29)
#  350|           if (val != NULL)
#  351|             {
#  352|->             char *str = YAJL_GET_STRING (val);
#  353|               ret->lower_link = strdup (str ? str : "");
#  354|               if (ret->lower_link == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:364:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:39: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:652:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:653:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:660:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:662:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:664:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: call_function: calling 'make_runtime_spec_schema_config_solaris_anet_element' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_anet_element'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:364:25: danger: 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)' leaks here; was allocated at [(30)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/29)
#  362|           if (val != NULL)
#  363|             {
#  364|->             char *str = YAJL_GET_STRING (val);
#  365|               ret->allowed_address = strdup (str ? str : "");
#  366|               if (ret->allowed_address == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:39: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:652:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:653:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:660:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:662:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:664:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: call_function: calling 'make_runtime_spec_schema_config_solaris_anet_element' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_anet_element'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: danger: '<unknown>' leaks here; was allocated at [(34)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/33)
#  408|         {
#  409|           yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
#  410|->         if (val != NULL)
#  411|             {
#  412|               char *str = YAJL_GET_STRING (val);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:598:1: enter_function: entry to 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:603:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:605:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:606:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:610:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:611:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:622:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:623:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:634:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:635:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:644:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:645:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:647:26: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:39: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:648:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:652:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:653:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:660:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:662:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:664:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: call_function: calling 'make_runtime_spec_schema_config_solaris_anet_element' from 'make_runtime_spec_schema_config_solaris'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:665:32: return_function: returning to 'make_runtime_spec_schema_config_solaris' from 'make_runtime_spec_schema_config_solaris_anet_element'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_solaris.c:410:12: danger: 'make_runtime_spec_schema_config_solaris_anet_element(val,  ctx,  err)' leaks here; was allocated at [(30)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/29)
#  408|         {
#  409|           yajl_val val = get_val (tree, "linkProtection", yajl_t_string);
#  410|->         if (val != NULL)
#  411|             {
#  412|               char *str = YAJL_GET_STRING (val);

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

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

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

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

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

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

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_vm_hypervisor(get_val(tree, "hypervisor", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:685:1: enter_function: entry to 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:690:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:692:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:693:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: call_function: calling 'make_runtime_spec_schema_config_vm_hypervisor' from 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: return_function: returning to 'make_runtime_spec_schema_config_vm' from 'make_runtime_spec_schema_config_vm_hypervisor'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:29:25: danger: 'make_runtime_spec_schema_config_vm_hypervisor(get_val(tree, "hypervisor", 3), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   27|           if (val != NULL)
#   28|             {
#   29|->             char *str = YAJL_GET_STRING (val);
#   30|               ret->path = strdup (str ? str : "");
#   31|               if (ret->path == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:69:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:685:1: enter_function: entry to 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:690:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:692:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:693:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: call_function: calling 'make_runtime_spec_schema_config_vm_hypervisor' from 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: return_function: returning to 'make_runtime_spec_schema_config_vm' from 'make_runtime_spec_schema_config_vm_hypervisor'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:69:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   67|         }
#   68|   
#   69|->     if (tree->type == yajl_t_object)
#   70|         {
#   71|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:214:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_hypervisor(*src.hypervisor)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: call_function: calling 'clone_runtime_spec_schema_config_vm_hypervisor' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_hypervisor'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:214:9: danger: 'clone_runtime_spec_schema_config_vm_hypervisor(*src.hypervisor)' leaks here; was allocated at [(8)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/7)
#  212|       if (ret == NULL)
#  213|         return NULL;
#  214|->     if (src->path)
#  215|         {
#  216|           ret->path = strdup (src->path);

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:220:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: call_function: calling 'clone_runtime_spec_schema_config_vm_hypervisor' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_hypervisor'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:220:8: danger: '<unknown>' leaks here; was allocated at [(12)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/11)
#  218|             return NULL;
#  219|         }
#  220|->     if (src->parameters)
#  221|         {
#  222|           ret->parameters_len = src->parameters_len;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def238]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:226:28: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: call_function: calling 'clone_runtime_spec_schema_config_vm_hypervisor' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:848:27: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_hypervisor'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:226:28: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/13)
#  224|           if (ret->parameters == NULL)
#  225|             return NULL;
#  226|->         for (size_t i = 0; i < src->parameters_len; i++)
#  227|             {
#  228|               if (src->parameters[i])

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_vm_kernel(get_val(tree, "kernel", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:685:1: enter_function: entry to 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:690:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:692:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:693:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: call_function: calling 'make_runtime_spec_schema_config_vm_kernel' from 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: return_function: returning to 'make_runtime_spec_schema_config_vm' from 'make_runtime_spec_schema_config_vm_kernel'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:256:25: danger: 'make_runtime_spec_schema_config_vm_kernel(get_val(tree, "kernel", 3), ctx,  err)' leaks here; was allocated at [(14)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/13)
#  254|           if (val != NULL)
#  255|             {
#  256|->             char *str = YAJL_GET_STRING (val);
#  257|               ret->path = strdup (str ? str : "");
#  258|               if (ret->path == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:308:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:685:1: enter_function: entry to 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:690:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:692:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:693:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:695:23: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:36: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:696:9: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: call_function: calling 'make_runtime_spec_schema_config_vm_kernel' from 'make_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:698:19: return_function: returning to 'make_runtime_spec_schema_config_vm' from 'make_runtime_spec_schema_config_vm_kernel'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:308:8: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/17)
#  306|         }
#  307|   
#  308|->     if (tree->type == yajl_t_object)
#  309|         {
#  310|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def241]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:468:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_kernel(*src.kernel)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: call_function: calling 'clone_runtime_spec_schema_config_vm_kernel' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_kernel'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:468:9: danger: 'clone_runtime_spec_schema_config_vm_kernel(*src.kernel)' leaks here; was allocated at [(10)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/9)
#  466|       if (ret == NULL)
#  467|         return NULL;
#  468|->     if (src->path)
#  469|         {
#  470|           ret->path = strdup (src->path);

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:490:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: call_function: calling 'clone_runtime_spec_schema_config_vm_kernel' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:854:23: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_kernel'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:490:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/13)
#  488|             }
#  489|         }
#  490|->     if (src->initrd)
#  491|         {
#  492|           ret->initrd = strdup (src->initrd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:668:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_image(*src.image)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: call_function: calling 'clone_runtime_spec_schema_config_vm_image' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_image'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:668:9: danger: 'clone_runtime_spec_schema_config_vm_image(*src.image)' leaks here; was allocated at [(12)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/11)
#  666|       if (ret == NULL)
#  667|         return NULL;
#  668|->     if (src->path)
#  669|         {
#  670|           ret->path = strdup (src->path);

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:674:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: call_function: calling 'clone_runtime_spec_schema_config_vm_image' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_image'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:674:8: danger: '<unknown>' leaks here; was allocated at [(16)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/15)
#  672|             return NULL;
#  673|         }
#  674|->     if (src->format)
#  675|         {
#  676|           ret->format = strdup (src->format);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:677:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:839:1: enter_function: entry to 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:844:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:846:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:852:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:858:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: call_function: calling 'clone_runtime_spec_schema_config_vm_image' from 'clone_runtime_spec_schema_config_vm'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:860:22: return_function: returning to 'clone_runtime_spec_schema_config_vm' from 'clone_runtime_spec_schema_config_vm_image'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:677:12: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/17)
#  675|         {
#  676|           ret->format = strdup (src->format);
#  677|->         if (ret->format == NULL)
#  678|             return NULL;
#  679|         }

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

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

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

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

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def260]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:47:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_memory(get_val(tree, "memory", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#   45|       while (0);
#   46|   
#   47|->     if (tree->type == yajl_t_object)
#   48|         {
#   49|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def261]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:234:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_cpu(get_val(tree, "cpu", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  232|       while (0);
#  233|   
#  234|->     if (tree->type == yajl_t_object)
#  235|         {
#  236|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:282:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  280|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  281|   
#  282|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  283|             ret->_residual = resi;
#  284|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:282:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  280|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  281|   
#  282|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  283|             ret->_residual = resi;
#  284|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:451:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources_storage(get_val(tree, "storage", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  449|       while (0);
#  450|   
#  451|->     if (tree->type == yajl_t_object)
#  452|         {
#  453|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:499:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  497|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  498|   
#  499|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  500|             ret->_residual = resi;
#  501|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:499:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
#  497|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  498|   
#  499|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  500|             ret->_residual = resi;
#  501|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:602:32: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1332:1: enter_function: entry to 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1337:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1339:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1340:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1344:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: call_function: calling 'make_runtime_spec_schema_config_windows_resources' from 'make_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1390:22: return_function: returning to 'make_runtime_spec_schema_config_windows' from 'make_runtime_spec_schema_config_windows_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:602:32: danger: 'make_runtime_spec_schema_config_windows_resources(get_val(tree, "resources", 3), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/9)
#  600|         return NULL;
#  601|       ret->memory = make_runtime_spec_schema_config_windows_resources_memory (get_val (tree, "memory", yajl_t_object), ctx, err);
#  602|->     if (ret->memory == NULL && *err != 0)
#  603|         return NULL;
#  604|       ret->cpu = make_runtime_spec_schema_config_windows_resources_cpu (get_val (tree, "cpu", yajl_t_object), ctx, err);

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:746:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_resources(*src.resources)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: call_function: calling 'clone_runtime_spec_schema_config_windows_resources' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:746:9: danger: 'clone_runtime_spec_schema_config_windows_resources(*src.resources)' leaks here; was allocated at [(12)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/11)
#  744|       if (ret == NULL)
#  745|         return NULL;
#  746|->     if (src->memory)
#  747|         {
#  748|           ret->memory = clone_runtime_spec_schema_config_windows_resources_memory (src->memory);

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:758:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: call_function: calling 'clone_runtime_spec_schema_config_windows_resources' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:758:8: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/17)
#  756|             return NULL;
#  757|         }
#  758|->     if (src->storage)
#  759|         {
#  760|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:761:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: call_function: calling 'clone_runtime_spec_schema_config_windows_resources' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1735:26: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_resources'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:761:12: danger: '<unknown>' leaks here; was allocated at [(22)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/21)
#  759|         {
#  760|           ret->storage = clone_runtime_spec_schema_config_windows_resources_storage (src->storage);
#  761|->         if (ret->storage == NULL)
#  762|             return NULL;
#  763|         }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1089:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_network(*src.network)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: call_function: calling 'clone_runtime_spec_schema_config_windows_network' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_network'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1089:9: danger: 'clone_runtime_spec_schema_config_windows_network(*src.network)' leaks here; was allocated at [(14)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/13)
# 1087|       if (ret == NULL)
# 1088|         return NULL;
# 1089|->     if (src->endpoint_list)
# 1090|         {
# 1091|           ret->endpoint_list_len = src->endpoint_list_len;

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1129:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: call_function: calling 'clone_runtime_spec_schema_config_windows_network' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1741:24: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_network'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1129:8: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/17)
# 1127|             return NULL;
# 1128|         }
# 1129|->     if (src->network_namespace)
# 1130|         {
# 1131|           ret->network_namespace = strdup (src->network_namespace);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1321:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_windows_hyperv(*src.hyperv)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1745:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1745:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1751:22: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1755:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: call_function: calling 'clone_runtime_spec_schema_config_windows_hyperv' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_hyperv'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1321:9: danger: 'clone_runtime_spec_schema_config_windows_hyperv(*src.hyperv)' leaks here; was allocated at [(18)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/17)
# 1319|       if (ret == NULL)
# 1320|         return NULL;
# 1321|->     if (src->utility_vm_path)
# 1322|         {
# 1323|           ret->utility_vm_path = strdup (src->utility_vm_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1324:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1697:1: enter_function: entry to 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1702:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1704:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1720:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1733:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1739:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1745:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1745:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1751:22: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1755:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: call_function: calling 'clone_runtime_spec_schema_config_windows_hyperv' from 'clone_runtime_spec_schema_config_windows'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1757:23: return_function: returning to 'clone_runtime_spec_schema_config_windows' from 'clone_runtime_spec_schema_config_windows_hyperv'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_config_windows.c:1324:12: danger: '<unknown>' leaks here; was allocated at [(22)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/21)
# 1322|         {
# 1323|           ret->utility_vm_path = strdup (src->utility_vm_path);
# 1324|->         if (ret->utility_vm_path == NULL)
# 1325|             return NULL;
# 1326|         }

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def290]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:437:9: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_id_mapping(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:577:1: enter_function: entry to 'make_runtime_spec_schema_defs_mount'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:582:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:584:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:585:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:589:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:590:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:601:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:602:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:613:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:640:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:651:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:652:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:659:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:661:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:663:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:664:40: call_function: calling 'make_runtime_spec_schema_defs_id_mapping' from 'make_runtime_spec_schema_defs_mount'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:664:40: return_function: returning to 'make_runtime_spec_schema_defs_mount' from 'make_runtime_spec_schema_defs_id_mapping'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:437:9: danger: 'make_runtime_spec_schema_defs_id_mapping(val,  ctx,  err)' leaks here; was allocated at [(22)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/21)
#  435|       while (0);
#  436|   
#  437|->     if (tree->type == yajl_t_object)
#  438|         {
#  439|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def291]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:485:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:577:1: enter_function: entry to 'make_runtime_spec_schema_defs_mount'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:582:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:584:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:585:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:589:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:590:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:601:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:602:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:613:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:640:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:651:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:652:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:659:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:661:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:663:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:664:40: call_function: calling 'make_runtime_spec_schema_defs_id_mapping' from 'make_runtime_spec_schema_defs_mount'
#  483|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  484|   
#  485|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  486|             ret->_residual = resi;
#  487|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:485:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:577:1: enter_function: entry to 'make_runtime_spec_schema_defs_mount'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:582:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:584:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:585:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:589:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:590:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:601:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:602:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:613:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:640:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:651:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:652:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:659:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:661:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:663:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs.c:664:40: call_function: calling 'make_runtime_spec_schema_defs_id_mapping' from 'make_runtime_spec_schema_defs_mount'
#  483|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  484|   
#  485|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  486|             ret->_residual = resi;
#  487|         }

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_defs_linux_syscall_arg(val,  ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:491:1: enter_function: entry to 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:496:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:498:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:499:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:503:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:530:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:541:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:542:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:563:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:564:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:571:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:573:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:575:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:576:32: call_function: calling 'make_runtime_spec_schema_defs_linux_syscall_arg' from 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:576:32: return_function: returning to 'make_runtime_spec_schema_defs_linux_syscall' from 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: danger: 'make_runtime_spec_schema_defs_linux_syscall_arg(val,  ctx,  err)' leaks here; was allocated at [(20)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/19)
#  314|           if (val != NULL)
#  315|             {
#  316|->             char *str = YAJL_GET_STRING (val);
#  317|               ret->op = strdup (str ? str : "");
#  318|               if (ret->op == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:330:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:491:1: enter_function: entry to 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:496:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:498:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:499:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:503:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:530:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:541:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:542:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:563:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:564:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:571:16: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:573:25: branch_true: following 'true' branch (when 'i < len')...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:575:38: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:576:32: call_function: calling 'make_runtime_spec_schema_defs_linux_syscall_arg' from 'make_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:576:32: return_function: returning to 'make_runtime_spec_schema_defs_linux_syscall' from 'make_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:330:8: danger: '<unknown>' leaks here; was allocated at [(30)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/29)
#  328|         }
#  329|   
#  330|->     if (tree->type == yajl_t_object)
#  331|         {
#  332|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:379:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:240:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:242:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:243:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:247:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:314:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:316:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:318:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:323:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:323:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:330:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:330:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:334:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:337:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:339:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:339:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:340:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:343:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:345:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:350:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:351:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:358:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:358:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:360:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:360:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:361:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:360:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:362:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:360:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:363:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:360:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:364:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:364:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:366:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:358:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:376:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:379:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:379:12: danger: 'resi' leaks here; was allocated at [(15)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/14)
#  377|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  378|   
#  379|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  380|             ret->_residual = resi;
#  381|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:474:18: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_defs_linux_syscall_arg(*<unknown>)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:786:1: enter_function: entry to 'clone_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:791:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:793:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:793:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:809:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:809:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:815:22: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:817:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:819:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:821:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:823:28: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:78: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:28: call_function: calling 'clone_runtime_spec_schema_defs_linux_syscall_arg' from 'clone_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:28: return_function: returning to 'clone_runtime_spec_schema_defs_linux_syscall' from 'clone_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:474:18: danger: 'clone_runtime_spec_schema_defs_linux_syscall_arg(*<unknown>)' leaks here; was allocated at [(16)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/15)
#  472|       if (ret == NULL)
#  473|         return NULL;
#  474|->     ret->index = src->index;
#  475|       ret->index_present = src->index_present;
#  476|       ret->value = src->value;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:483:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:786:1: enter_function: entry to 'clone_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:791:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:793:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:793:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:809:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:809:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:815:22: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:817:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:819:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:821:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:823:28: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:78: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:28: call_function: calling 'clone_runtime_spec_schema_defs_linux_syscall_arg' from 'clone_runtime_spec_schema_defs_linux_syscall'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:825:28: return_function: returning to 'clone_runtime_spec_schema_defs_linux_syscall' from 'clone_runtime_spec_schema_defs_linux_syscall_arg'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:483:12: danger: '<unknown>' leaks here; was allocated at [(20)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/19)
#  481|         {
#  482|           ret->op = strdup (src->op);
#  483|->         if (ret->op == NULL)
#  484|             return NULL;
#  485|         }

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def307]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1306:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1209:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1211:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1212:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1216:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1239:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1259:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1259:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1263:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1266:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1268:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1268:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1269:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1272:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1274:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1279:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1280:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1287:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1287:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1289:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1289:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1290:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1289:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1291:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1291:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1293:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1287:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1303:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1306:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1306:12: danger: 'resi' leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
# 1304|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1305|   
# 1306|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1307|             ret->_residual = resi;
# 1308|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def308]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1532:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1389:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1391:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1392:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1396:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1463:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1483:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1483:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1487:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1490:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1492:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1492:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1493:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1496:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1498:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1503:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1504:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1511:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1511:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1513:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1513:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1514:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1513:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1515:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1513:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1516:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1513:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1517:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1517:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1519:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1511:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1529:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1532:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1532:12: danger: 'resi' leaks here; was allocated at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
# 1530|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1531|   
# 1532|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1533|             ret->_residual = resi;
# 1534|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1763:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1643:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1645:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1646:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1650:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1695:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1715:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1715:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1719:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1722:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1724:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1724:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1725:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1728:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1730:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1735:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1736:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1743:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1743:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1745:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1745:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1746:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1745:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1747:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1745:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1748:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1748:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1750:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1743:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1760:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1763:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:1763:12: danger: 'resi' leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
# 1761|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 1762|   
# 1763|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 1764|             ret->_residual = resi;
# 1765|         }

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def312]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2234:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2141:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2143:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2144:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2148:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2149:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2151:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2153:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2160:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2161:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2180:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2180:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2187:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2187:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2191:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2194:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2196:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2196:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2197:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2200:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2202:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2207:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2208:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2215:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2215:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2217:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2217:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2218:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2217:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2219:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2219:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2221:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2234:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2234:12: danger: 'resi' leaks here; was allocated at [(17)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/16)
# 2232|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2233|   
# 2234|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2235|             ret->_residual = resi;
# 2236|         }

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def314]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2420:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2323:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2325:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2326:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2330:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2353:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2373:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2373:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2377:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2380:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2382:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2382:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2383:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2386:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2388:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2393:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2394:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2401:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2401:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2403:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2403:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2404:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2403:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2405:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2405:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2407:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2401:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2417:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2420:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2420:12: danger: 'resi' leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
# 2418|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2419|   
# 2420|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2421|             ret->_residual = resi;
# 2422|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def315]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2586:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2503:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2505:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2506:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2510:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2511:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2513:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2515:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2522:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2523:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2532:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2532:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2539:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2539:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2543:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2546:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2548:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2548:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2549:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2552:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2554:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2559:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2560:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2567:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2567:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2569:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2569:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2570:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2569:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2571:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2571:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2573:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2586:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2586:12: danger: 'resi' leaks here; was allocated at [(17)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/16)
# 2584|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2585|   
# 2586|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2587|             ret->_residual = resi;
# 2588|         }

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def318]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2778:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2681:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2683:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2684:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2688:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2711:12: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2731:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2731:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2735:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2738:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2740:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2740:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2741:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2744:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2746:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2751:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2752:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2759:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2759:21: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2761:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2761:16: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2762:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2761:17: branch_true: following 'true' branch (when the strings are non-equal)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2763:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2763:20: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2765:21: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2759:21: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2775:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2778:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_linux.c:2778:12: danger: 'resi' leaks here; was allocated at [(11)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/10)
# 2776|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
# 2777|   
# 2778|->         if (ctx->options & OPT_PARSE_FULLKEY)
# 2779|             ret->_residual = resi;
# 2780|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:19:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:22:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:26:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:27:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:31:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:38:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:39:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:43:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:48:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:48:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:54:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:54:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:61:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:61:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:65:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:68:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:70:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:71:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:74:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:75:35: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:76:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:81:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:82:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:89:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: danger: '<unknown>' leaks here; was allocated at [(23)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/22)
#  106|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  107|   
#  108|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  109|             ret->_residual = resi;
#  110|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def320]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:19:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:21:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:22:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:26:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:27:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:29:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:31:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:38:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:39:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:41:25: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:43:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:48:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:48:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:54:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:54:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:61:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:61:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:65:16: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:68:12: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:70:20: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:70:20: acquire_memory: allocated here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:71:16: branch_false: following 'false' branch (when 'resi' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:74:13: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:76:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:81:37: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:82:16: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:89:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_defs_windows.c:108:12: danger: 'resi' leaks here; was allocated at [(21)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/20)
#  106|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  107|   
#  108|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  109|             ret->_residual = resi;
#  110|         }

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def325]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:29:23: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1540:1: enter_function: entry to 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1545:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1547:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1548:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1552:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: call_function: calling 'make_runtime_spec_schema_features_linux_cgroup' from 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: return_function: returning to 'make_runtime_spec_schema_features_linux' from 'make_runtime_spec_schema_features_linux_cgroup'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:29:23: danger: 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   27|           if (val != NULL)
#   28|             {
#   29|->             ret->v1 = YAJL_IS_TRUE(val);
#   30|               ret->v1_present = 1;
#   31|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:48:23: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1540:1: enter_function: entry to 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1545:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1547:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1548:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1552:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: call_function: calling 'make_runtime_spec_schema_features_linux_cgroup' from 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: return_function: returning to 'make_runtime_spec_schema_features_linux' from 'make_runtime_spec_schema_features_linux_cgroup'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:48:23: danger: 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/9)
#   46|           if (val != NULL)
#   47|             {
#   48|->             ret->v2 = YAJL_IS_TRUE(val);
#   49|               ret->v2_present = 1;
#   50|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def327]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:67:28: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1540:1: enter_function: entry to 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1545:8: branch_false: following 'false' branch (when 'tree' is non-NULL)...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1547:11: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1548:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1552:24: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: call_function: calling 'make_runtime_spec_schema_features_linux_cgroup' from 'make_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1602:19: return_function: returning to 'make_runtime_spec_schema_features_linux' from 'make_runtime_spec_schema_features_linux_cgroup'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:67:28: danger: 'make_runtime_spec_schema_features_linux_cgroup(get_val(tree, "cgroup", 3), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#   65|           if (val != NULL)
#   66|             {
#   67|->             ret->systemd = YAJL_IS_TRUE(val);
#   68|               ret->systemd_present = 1;
#   69|             }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:759:20: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_features_linux_seccomp(*src.seccomp)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1874:1: enter_function: entry to 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1879:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: call_function: calling 'clone_runtime_spec_schema_features_linux_seccomp' from 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: return_function: returning to 'clone_runtime_spec_schema_features_linux' from 'clone_runtime_spec_schema_features_linux_seccomp'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:759:20: danger: 'clone_runtime_spec_schema_features_linux_seccomp(*src.seccomp)' leaks here; was allocated at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
#  757|       if (ret == NULL)
#  758|         return NULL;
#  759|->     ret->enabled = src->enabled;
#  760|       ret->enabled_present = src->enabled_present;
#  761|       if (src->actions)

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:825:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1874:1: enter_function: entry to 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1879:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: call_function: calling 'clone_runtime_spec_schema_features_linux_seccomp' from 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1921:24: return_function: returning to 'clone_runtime_spec_schema_features_linux' from 'clone_runtime_spec_schema_features_linux_seccomp'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:825:8: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/17)
#  823|             }
#  824|         }
#  825|->     if (src->supported_flags)
#  826|         {
#  827|           ret->supported_flags_len = src->supported_flags_len;

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1529:9: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_features_linux_mount_extensions(*src.mount_extensions)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1874:1: enter_function: entry to 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1879:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1925:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1925:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1931:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1931:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1937:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1937:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1943:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1943:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: call_function: calling 'clone_runtime_spec_schema_features_linux_mount_extensions' from 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: return_function: returning to 'clone_runtime_spec_schema_features_linux' from 'clone_runtime_spec_schema_features_linux_mount_extensions'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1529:9: danger: 'clone_runtime_spec_schema_features_linux_mount_extensions(*src.mount_extensions)' leaks here; was allocated at [(22)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/21)
# 1527|       if (ret == NULL)
# 1528|         return NULL;
# 1529|->     if (src->idmap)
# 1530|         {
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def336]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1532:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1874:1: enter_function: entry to 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1879:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1881:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1897:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1913:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1919:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1925:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1925:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1931:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1931:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1937:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1937:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1943:9: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1943:8: branch_true: following 'true' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: branch_true: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: call_function: calling 'clone_runtime_spec_schema_features_linux_mount_extensions' from 'clone_runtime_spec_schema_features_linux'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1945:33: return_function: returning to 'clone_runtime_spec_schema_features_linux' from 'clone_runtime_spec_schema_features_linux_mount_extensions'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1532:12: danger: '<unknown>' leaks here; was allocated at [(28)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/27)
# 1530|         {
# 1531|           ret->idmap = clone_runtime_spec_schema_features_linux_mount_extensions_idmap (src->idmap);
# 1532|->         if (ret->idmap == NULL)
# 1533|             return NULL;
# 1534|         }

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

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

Error: GCC_ANALYZER_WARNING (CWE-401): [#def339]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_features_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:539:40: enter_function: entry to 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:545:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:548:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:553:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: call_function: calling 'make_runtime_spec_schema_features_schema' from 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: return_function: returning to 'runtime_spec_schema_features_schema_parse_data' from 'make_runtime_spec_schema_features_schema'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:29:25: danger: 'make_runtime_spec_schema_features_schema(yajl_tree_parse(jsondata, & errbuf, 1024), ctx,  err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#   27|           if (val != NULL)
#   28|             {
#   29|->             char *str = YAJL_GET_STRING (val);
#   30|               ret->oci_version_min = strdup (str ? str : "");
#   31|               if (ret->oci_version_min == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def340]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:160:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:539:40: enter_function: entry to 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:545:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:548:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:553:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: call_function: calling 'make_runtime_spec_schema_features_schema' from 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: return_function: returning to 'runtime_spec_schema_features_schema_parse_data' from 'make_runtime_spec_schema_features_schema'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:160:8: danger: '<unknown>' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  158|         }
#  159|   
#  160|->     if (tree->type == yajl_t_object)
#  161|         {
#  162|           size_t i;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def341]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:539:40: enter_function: entry to 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:545:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:548:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:553:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: call_function: calling 'make_runtime_spec_schema_features_schema' from 'runtime_spec_schema_features_schema_parse_data'
#  210|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  211|   
#  212|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  213|             ret->_residual = resi;
#  214|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def342]
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:539:40: enter_function: entry to 'runtime_spec_schema_features_schema_parse_data'
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:545:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:548:5: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:553:8: branch_false: following 'false' branch...
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: branch_false: ...to here
crun-1.21/libocispec/src/ocispec/runtime_spec_schema_features_schema.c:559:7: call_function: calling 'make_runtime_spec_schema_features_schema' from 'runtime_spec_schema_features_schema_parse_data'
#  210|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  211|   
#  212|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  213|             ret->_residual = resi;
#  214|         }

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

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

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

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

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

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

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

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

Error: CPPCHECK_WARNING (CWE-457): [#def351]
crun-1.21/src/libcrun/blake3/blake3.c:229: warning[uninitvar]: Uninitialized variable: parents_array
#  227|     }
#  228|   
#  229|->   blake3_hash_many(parents_array, parents_array_len, 1, key,
#  230|                      0, // Parents always use counter 0.
#  231|                      false, flags | PARENT,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def352]
crun-1.21/src/libcrun/cgroup-cgroupfs.c:82:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 720896)'
crun-1.21/src/libcrun/cgroup-cgroupfs.c:68:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-cgroupfs.c:71:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-cgroupfs.c:72:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-cgroupfs.c:78:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-cgroupfs.c:79:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-cgroupfs.c:82:12: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-cgroupfs.c:82:12: acquire_resource: opened here
crun-1.21/src/libcrun/cgroup-cgroupfs.c:82:12: danger: 'open(cgroup_path, 720896)' leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   80|       return ret;
#   81|   
#   82|->   *dirfd = open (cgroup_path, O_CLOEXEC | O_NOFOLLOW | O_DIRECTORY | O_RDONLY);
#   83|     if (UNLIKELY (*dirfd < 0))
#   84|       return crun_make_error (err, errno, "open `%s`", cgroup_path);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def353]
crun-1.21/src/libcrun/cgroup-resources.c:153:12: warning[-Wanalyzer-null-argument]: use of NULL 'controllers' where non-null expected
crun-1.21/src/libcrun/cgroup-resources.c:1371:1: enter_function: entry to 'update_cgroup_resources'
crun-1.21/src/libcrun/cgroup-resources.c:1381:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: following 'false' branch (when 'path' is non-NULL)...
crun-1.21/src/libcrun/cgroup-resources.c:1406:3: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1409:14: call_function: calling 'update_cgroup_v2_resources' from 'update_cgroup_resources'
#argument 1 of '__builtin_strchr' must be non-null
#  151|         key = xstrdup (name);
#  152|   
#  153|->       it = strchr (key, '.');
#  154|         if (it == NULL)
#  155|           {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def354]
crun-1.21/src/libcrun/cgroup-resources.c:1311:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 589824)'
crun-1.21/src/libcrun/cgroup-resources.c:1371:1: enter_function: entry to 'update_cgroup_resources'
crun-1.21/src/libcrun/cgroup-resources.c:1381:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: following 'false' branch (when 'path' is non-NULL)...
crun-1.21/src/libcrun/cgroup-resources.c:1406:3: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1409:14: call_function: calling 'update_cgroup_v2_resources' from 'update_cgroup_resources'
# 1309|       return ret;
# 1310|   
# 1311|->   cgroup_dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
# 1312|     if (UNLIKELY (cgroup_dirfd < 0))
# 1313|       return crun_make_error (err, errno, "open `%s`", cgroup_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def355]
crun-1.21/src/libcrun/cgroup-setup.c:53:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 2686976)'
crun-1.21/src/libcrun/cgroup-setup.c:493:1: enter_function: entry to 'enter_cgroup'
crun-1.21/src/libcrun/cgroup-setup.c:497:6: branch_false: following 'false' branch (when 'cgroup_mode != 1')...
crun-1.21/src/libcrun/cgroup-setup.c:505:13: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-setup.c:505:13: call_function: calling 'enter_cgroup_v1' from 'enter_cgroup'
#   51|     int b_len;
#   52|   
#   53|->   dirfd = open (path, O_DIRECTORY | O_PATH | O_CLOEXEC);
#   54|     if (UNLIKELY (dirfd < 0))
#   55|       return crun_make_error (err, errno, "open `%s`", path);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def356]
crun-1.21/src/libcrun/cgroup-setup.c:155:10: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
crun-1.21/src/libcrun/cgroup-setup.c:493:1: enter_function: entry to 'enter_cgroup'
crun-1.21/src/libcrun/cgroup-setup.c:497:6: branch_false: following 'false' branch (when 'cgroup_mode != 1')...
crun-1.21/src/libcrun/cgroup-setup.c:505:13: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-setup.c:505:13: call_function: calling 'enter_cgroup_v1' from 'enter_cgroup'
#argument 1 of '__builtin_strlen' must be non-null
#  153|   
#  154|     cpus_buf[0] = mems_buf[0] = '\0';
#  155|->   return initialize_cpuset_subsystem_rec (tmp_path, strlen (tmp_path), cpus_buf, mems_buf, NULL, err);
#  156|   }
#  157|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def357]
crun-1.21/src/libcrun/cgroup-setup.c:461:15: warning[-Wanalyzer-null-argument]: use of NULL 'cgroup_crun_exec_path' where non-null expected
crun-1.21/src/libcrun/cgroup-setup.c:493:1: enter_function: entry to 'enter_cgroup'
crun-1.21/src/libcrun/cgroup-setup.c:497:6: branch_true: following 'true' branch (when 'cgroup_mode == 1')...
crun-1.21/src/libcrun/cgroup-setup.c:499:13: branch_true: ...to here
crun-1.21/src/libcrun/cgroup-setup.c:499:13: call_function: calling 'enter_cgroup_v2' from 'enter_cgroup'
#  459|   
#  460|             /* Make sure the cgroup is below the initial cgroup specified for the container.  */
#  461|->           if (strncmp (path, cgroup_crun_exec_path, strlen (path)))
#  462|               {
#  463|                 free (cgroup_crun_exec_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def358]
crun-1.21/src/libcrun/cgroup-setup.c:490:1: warning[-Wanalyzer-malloc-leak]: leak of 'cgroup_crun_exec_path'
crun-1.21/src/libcrun/cgroup-setup.c:493:1: enter_function: entry to 'enter_cgroup'
crun-1.21/src/libcrun/cgroup-setup.c:497:6: branch_true: following 'true' branch (when 'cgroup_mode == 1')...
crun-1.21/src/libcrun/cgroup-setup.c:499:13: branch_true: ...to here
crun-1.21/src/libcrun/cgroup-setup.c:499:13: call_function: calling 'enter_cgroup_v2' from 'enter_cgroup'
#  488|       }
#  489|     return ret;
#  490|-> }
#  491|   
#  492|   int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def359]
crun-1.21/src/libcrun/cgroup-utils.c:308:13: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(dfd)'
crun-1.21/src/libcrun/cgroup-utils.c:992:1: enter_function: entry to 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1002:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: call_function: calling 'libcrun_cgroup_pause_unpause_path' from 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: return_function: returning to 'libcrun_migrate_all_pids_to_cgroup' from 'libcrun_cgroup_pause_unpause_path'
crun-1.21/src/libcrun/cgroup-utils.c:1006:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: call_function: calling 'libcrun_cgroup_read_pids_from_path' from 'libcrun_migrate_all_pids_to_cgroup'
#  306|         struct dirent *de;
#  307|   
#  308|->       dir = fdopendir (dfd);
#  309|         if (UNLIKELY (dir == NULL))
#  310|           return crun_make_error (err, errno, "open cgroup sub-directory");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def360]
crun-1.21/src/libcrun/cgroup-utils.c:444:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 589824)'
crun-1.21/src/libcrun/cgroup-utils.c:992:1: enter_function: entry to 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1002:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: call_function: calling 'libcrun_cgroup_pause_unpause_path' from 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: return_function: returning to 'libcrun_migrate_all_pids_to_cgroup' from 'libcrun_cgroup_pause_unpause_path'
crun-1.21/src/libcrun/cgroup-utils.c:1006:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: call_function: calling 'libcrun_cgroup_read_pids_from_path' from 'libcrun_migrate_all_pids_to_cgroup'
#  442|       }
#  443|   
#  444|->   dirfd = open (cgroup_path, O_DIRECTORY | O_CLOEXEC);
#  445|     if (dirfd < 0)
#  446|       return crun_make_error (err, errno, "open `%s`", cgroup_path);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def361]
crun-1.21/src/libcrun/cgroup.c:208:10: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:199:1: enter_function: entry to 'libcrun_cgroup_destroy'
crun-1.21/src/libcrun/cgroup.c:201:34: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:204:9: call_function: calling 'get_cgroup_manager' from 'libcrun_cgroup_destroy'
crun-1.21/src/libcrun/cgroup.c:204:9: return_function: returning to 'libcrun_cgroup_destroy' from 'get_cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:205:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:208:24: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:208:24: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:208:10: danger: 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): [#def362]
crun-1.21/src/libcrun/cgroup.c:224:7: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:212:1: enter_function: entry to 'libcrun_update_cgroup_resources'
crun-1.21/src/libcrun/cgroup.c:217:34: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:220:9: call_function: calling 'get_cgroup_manager' from 'libcrun_update_cgroup_resources'
crun-1.21/src/libcrun/cgroup.c:220:9: return_function: returning to 'libcrun_update_cgroup_resources' from 'get_cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:221:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:224:21: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:224:21: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:224:7: danger: 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): [#def363]
crun-1.21/src/libcrun/cgroup.c:282:7: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:263:1: enter_function: entry to 'libcrun_cgroup_preenter'
crun-1.21/src/libcrun/cgroup.c:272:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:275:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:275:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:278:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:278:9: call_function: calling 'get_cgroup_manager' from 'libcrun_cgroup_preenter'
crun-1.21/src/libcrun/cgroup.c:278:9: return_function: returning to 'libcrun_cgroup_preenter' from 'get_cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:279:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:282:21: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:282:21: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:282:7: danger: 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): [#def364]
crun-1.21/src/libcrun/cgroup.c:323:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:289:1: enter_function: entry to 'libcrun_cgroup_enter'
crun-1.21/src/libcrun/cgroup.c:292:64: call_function: calling 'xmalloc0' from 'libcrun_cgroup_enter'
crun-1.21/src/libcrun/cgroup.c:292:64: return_function: returning to 'libcrun_cgroup_enter' from 'xmalloc0'
crun-1.21/src/libcrun/cgroup.c:300:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:303:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:317:9: call_function: calling 'get_cgroup_manager' from 'libcrun_cgroup_enter'
crun-1.21/src/libcrun/cgroup.c:317:9: return_function: returning to 'libcrun_cgroup_enter' from 'get_cgroup_manager'
crun-1.21/src/libcrun/cgroup.c:318:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup.c:321:21: branch_false: ...to here
crun-1.21/src/libcrun/cgroup.c:323:23: release_memory: 'cgroup_manager' is NULL
crun-1.21/src/libcrun/cgroup.c:323:9: danger: 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): [#def365]
crun-1.21/src/libcrun/cloned_binary.c:191:40: warning[-Wanalyzer-malloc-leak]: leak of 'read_file("/proc/self/cmdline", &cmdline_size)'
crun-1.21/src/libcrun/cloned_binary.c:539:5: enter_function: entry to 'ensure_cloned_binary'
crun-1.21/src/libcrun/cloned_binary.c:546:12: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cloned_binary.c:549:13: branch_false: ...to here
crun-1.21/src/libcrun/cloned_binary.c:549:13: call_function: calling 'fetchve' from 'ensure_cloned_binary'
#  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): [#def366]
crun-1.21/src/libcrun/cloned_binary.c:223:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.21/src/libcrun/cloned_binary.c:539:5: enter_function: entry to 'ensure_cloned_binary'
crun-1.21/src/libcrun/cloned_binary.c:542:16: release_memory: 'argv' is NULL
crun-1.21/src/libcrun/cloned_binary.c:546:12: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cloned_binary.c:549:13: branch_false: ...to here
crun-1.21/src/libcrun/cloned_binary.c:549:13: call_function: calling 'fetchve' from 'ensure_cloned_binary'
#  221|   		cur += strlen(cur) + 1;
#  222|   	}
#  223|-> 	(*output)[num] = NULL;
#  224|   	return num;
#  225|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def367]
crun-1.21/src/libcrun/container.c:556:10: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/src/libcrun/container.c:4321:1: enter_function: entry to 'libcrun_container_restore'
crun-1.21/src/libcrun/container.c:4337:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_restore'
#  554|       container->config_file_content = xstrdup (config);
#  555|   
#  556|->   return container;
#  557|   }
#  558|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def368]
crun-1.21/src/libcrun/container.c:1745:11: warning[-Wanalyzer-null-dereference]: dereference of NULL 'container'
crun-1.21/src/libcrun/container.c:4240:1: enter_function: entry to 'libcrun_container_checkpoint'
crun-1.21/src/libcrun/container.c:4246:42: release_memory: 'container' is NULL
crun-1.21/src/libcrun/container.c:4246:42: release_memory: 'container' is NULL
crun-1.21/src/libcrun/container.c:4249:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4252:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4253:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4255:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4255:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4258:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4258:9: call_function: calling 'read_container_config_from_state' from 'libcrun_container_checkpoint'
crun-1.21/src/libcrun/container.c:4258:9: return_function: returning to 'libcrun_container_checkpoint' from 'read_container_config_from_state'
crun-1.21/src/libcrun/container.c:4259:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4261:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4261:9: release_memory: 'container' is NULL
crun-1.21/src/libcrun/container.c:4262:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4265:10: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4265:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4266:12: call_function: calling 'container_delete_internal' from 'libcrun_container_checkpoint'
# 1743|               return ret;
# 1744|   
# 1745|->           def = container->container_def;
# 1746|           }
# 1747|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def369]
crun-1.21/src/libcrun/container.c:3728:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'process'
crun-1.21/src/libcrun/container.c:3352:1: enter_function: entry to 'libcrun_container_exec_process_file'
crun-1.21/src/libcrun/container.c:3360:10: call_function: calling 'libcrun_container_exec_with_options' from 'libcrun_container_exec_process_file'
# 3726|   
# 3727|     /* This must be done before we enter a user namespace.  */
# 3728|->   ret = libcrun_set_rlimits (process->rlimits, process->rlimits_len, err);
# 3729|     if (UNLIKELY (ret < 0))
# 3730|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def370]
crun-1.21/src/libcrun/container.c:3743:9: warning[-Wanalyzer-malloc-leak]: leak of '*process.selinux_label'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3740:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3742:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3742:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3743:34: call_function: calling 'xstrdup' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3743:34: return_function: returning to 'libcrun_container_exec_with_options' from 'xstrdup'
crun-1.21/src/libcrun/container.c:3743:9: danger: '*process.selinux_label' leaks here; was allocated at [(58)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/57)
# 3741|       {
# 3742|         if (process->selinux_label == NULL && container->container_def->process->selinux_label)
# 3743|->         process->selinux_label = xstrdup (container->container_def->process->selinux_label);
# 3744|   
# 3745|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def371]
crun-1.21/src/libcrun/container.c:3746:9: warning[-Wanalyzer-malloc-leak]: leak of '*process.apparmor_profile'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3740:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3742:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3745:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3746:37: call_function: calling 'xstrdup' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3746:37: return_function: returning to 'libcrun_container_exec_with_options' from 'xstrdup'
crun-1.21/src/libcrun/container.c:3746:9: danger: '*process.apparmor_profile' leaks here; was allocated at [(58)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/57)
# 3744|   
# 3745|         if (process->apparmor_profile == NULL && container->container_def->process->apparmor_profile)
# 3746|->         process->apparmor_profile = xstrdup (container->container_def->process->apparmor_profile);
# 3747|   
# 3748|         if (process->user == NULL && container->container_def->process->user)

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def372]
crun-1.21/src/libcrun/container.c:3772:7: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd0'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/src/libcrun/container.c:3772:7: release_resource: first 'close' here
crun-1.21/src/libcrun/container.c:3772:7: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3772:7: danger: second 'close' here; first 'close' was at [(66)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/65)
# 3770|     if (pid == 0)
# 3771|       {
# 3772|->       TEMP_FAILURE_RETRY (close (pipefd0));
# 3773|         pipefd0 = -1;
# 3774|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def373]
crun-1.21/src/libcrun/container.c:3783:3: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'pipefd1'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3783:3: release_resource: first 'close' here
crun-1.21/src/libcrun/container.c:3783:3: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3783:3: danger: second 'close' here; first 'close' was at [(66)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/65)
# 3781|       }
# 3782|   
# 3783|->   TEMP_FAILURE_RETRY (close (pipefd1));
# 3784|     pipefd1 = -1;
# 3785|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def374]
crun-1.21/src/libcrun/criu.c:313:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.21/src/libcrun/criu.c:268:22: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:270:9: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:277:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:280:6: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:280:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/criu.c:293:6: branch_true: following 'true' branch (when 'has_cgroup_mount != 0')...
crun-1.21/src/libcrun/criu.c:296:9: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:297:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:300:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:300:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:303:51: branch_true: following 'true' branch (when 'from' is non-NULL)...
crun-1.21/src/libcrun/criu.c:305:26: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:305:26: release_memory: 'destination' is NULL
crun-1.21/src/libcrun/criu.c:306:26: release_memory: 'destination' is NULL
crun-1.21/src/libcrun/criu.c:313:7: danger: dereference of NULL 'strchr(subsystem, 58)'
#  311|         subsystem = strchr (from, ':') + 1;
#  312|         subpath = strchr (subsystem, ':') + 1;
#  313|->       *(subpath - 1) = '\0';
#  314|   
#  315|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def375]
crun-1.21/src/libcrun/criu.c:315:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.21/src/libcrun/criu.c:268:22: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:270:9: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:277:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:280:6: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:280:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/criu.c:293:6: branch_true: following 'true' branch (when 'has_cgroup_mount != 0')...
crun-1.21/src/libcrun/criu.c:296:9: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:297:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:300:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:300:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:303:51: branch_true: following 'true' branch (when 'from' is non-NULL)...
crun-1.21/src/libcrun/criu.c:305:26: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:305:26: release_memory: 'destination' is NULL
crun-1.21/src/libcrun/criu.c:306:26: release_memory: 'destination' is NULL
crun-1.21/src/libcrun/criu.c:315:11: danger: dereference of NULL 'strchr(from, 58)'
#  313|         *(subpath - 1) = '\0';
#  314|   
#  315|->       if (subsystem[0] == '\0')
#  316|           continue;
#  317|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def376]
crun-1.21/src/libcrun/criu.c:382:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.21/src/libcrun/criu.c:346:22: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:348:9: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:363:6: branch_true: following 'true' branch (when 'has_cgroup_mount != 0')...
crun-1.21/src/libcrun/criu.c:366:9: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:367:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:370:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:370:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:373:51: branch_true: following 'true' branch (when 'from' is non-NULL)...
crun-1.21/src/libcrun/criu.c:375:26: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:375:26: release_memory: 'source_path' is NULL
crun-1.21/src/libcrun/criu.c:382:7: danger: dereference of NULL 'strchr(subsystem, 58)'
#  380|         subsystem = strchr (from, ':') + 1;
#  381|         subpath = strchr (subsystem, ':') + 1;
#  382|->       *(subpath - 1) = '\0';
#  383|   
#  384|         if (subsystem[0] == '\0')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def377]
crun-1.21/src/libcrun/criu.c:384:11: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
crun-1.21/src/libcrun/criu.c:346:22: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:348:9: release_memory: 'content' is NULL
crun-1.21/src/libcrun/criu.c:363:6: branch_true: following 'true' branch (when 'has_cgroup_mount != 0')...
crun-1.21/src/libcrun/criu.c:366:9: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:367:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:370:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:370:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:373:51: branch_true: following 'true' branch (when 'from' is non-NULL)...
crun-1.21/src/libcrun/criu.c:375:26: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:375:26: release_memory: 'source_path' is NULL
crun-1.21/src/libcrun/criu.c:384:11: danger: dereference of NULL 'strchr(from, 58)'
#  382|         *(subpath - 1) = '\0';
#  383|   
#  384|->       if (subsystem[0] == '\0')
#  385|           continue;
#  386|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def378]
crun-1.21/src/libcrun/criu.c:461:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.21/src/libcrun/criu.c:409:1: enter_function: entry to 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: call_function: calling 'load_wrapper' from 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: return_function: returning to 'libcrun_container_checkpoint_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:424:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:427:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:427:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:447:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:448:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:451:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:451:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:454:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:454:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:457:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:461:14: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:461:14: danger: 'open(*cr_options.image_path, 589824)' leaks here; was opened at [(20)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/19)
#  459|       return crun_make_error (err, errno, "error creating checkpoint directory `%s`", cr_options->image_path);
#  460|   
#  461|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  462|     if (UNLIKELY (image_fd == -1))
#  463|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def379]
crun-1.21/src/libcrun/criu.c:481:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.21/src/libcrun/criu.c:409:1: enter_function: entry to 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: call_function: calling 'load_wrapper' from 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: return_function: returning to 'libcrun_container_checkpoint_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:424:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:427:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:427:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:447:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:448:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:451:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:451:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:454:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:454:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:457:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:462:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:465:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:479:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:481:17: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:481:17: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:481:17: danger: 'open(*cr_options.work_path, 589824)' leaks here; was opened at [(24)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/23)
#  479|     if (cr_options->work_path != NULL)
#  480|       {
#  481|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  482|         if (UNLIKELY (work_fd == -1))
#  483|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def380]
crun-1.21/src/libcrun/criu.c:746:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(root, 524288)'
crun-1.21/src/libcrun/criu.c:702:15: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:704:20: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:712:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:717:19: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:719:30: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:746:17: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:746:17: danger: 'open(root, 524288)' leaks here; was opened at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  744|           }
#  745|   
#  746|->       root_fd = open (root, O_RDONLY | O_CLOEXEC);
#  747|         if (UNLIKELY (root_fd == -1))
#  748|           return crun_make_error (err, errno, "error opening container root directory `%s`", root);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def381]
crun-1.21/src/libcrun/criu.c:804:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.image_path, 589824)'
crun-1.21/src/libcrun/criu.c:772:1: enter_function: entry to 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: call_function: calling 'load_wrapper' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: return_function: returning to 'libcrun_container_restore_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:788:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:791:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:791:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:794:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:795:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:798:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:798:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:801:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:801:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:804:14: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:804:14: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:804:14: danger: 'open(*cr_options.image_path, 589824)' leaks here; was opened at [(20)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/19)
#  802|       return crun_make_error (err, 0, "image path not set");
#  803|   
#  804|->   image_fd = open (cr_options->image_path, O_DIRECTORY | O_CLOEXEC);
#  805|     if (UNLIKELY (image_fd == -1))
#  806|       return crun_make_error (err, errno, "error opening checkpoint directory `%s`", cr_options->image_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def382]
crun-1.21/src/libcrun/criu.c:860:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*cr_options.work_path, 589824)'
crun-1.21/src/libcrun/criu.c:772:1: enter_function: entry to 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: call_function: calling 'load_wrapper' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: return_function: returning to 'libcrun_container_restore_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:788:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:791:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:791:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:794:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:795:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:798:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:798:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:801:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:801:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:804:14: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:805:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:808:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:818:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:821:11: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:822:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:831:12: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:832:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:835:17: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:858:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:860:17: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:860:17: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:860:17: danger: 'open(*cr_options.work_path, 589824)' leaks here; was opened at [(30)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/29)
#  858|     if (cr_options->work_path != NULL)
#  859|       {
#  860|->       work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
#  861|         if (UNLIKELY (work_fd == -1))
#  862|           return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def383]
crun-1.21/src/libcrun/criu.c:969:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_163.path, 0)'
crun-1.21/src/libcrun/criu.c:772:1: enter_function: entry to 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: call_function: calling 'load_wrapper' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: return_function: returning to 'libcrun_container_restore_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:788:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:791:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:791:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:794:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:795:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:798:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:798:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:801:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:801:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:804:14: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:805:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:808:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:818:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:821:11: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:822:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:831:12: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:832:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:835:17: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:922:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:925:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:926:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:929:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:930:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:943:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:944:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:947:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:948:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/criu.c:960:15: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:963:43: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:964:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:967:10: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:967:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:969:32: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:969:32: danger: 'open(**_163.path, 0)' leaks here; was opened at [(44)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/43)
#  967|         if (value == CLONE_NEWNET && def->linux->namespaces[i]->path != NULL)
#  968|           {
#  969|->           inherit_new_net_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  970|             if (UNLIKELY (inherit_new_net_fd < 0))
#  971|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def384]
crun-1.21/src/libcrun/criu.c:980:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_184.path, 0)'
crun-1.21/src/libcrun/criu.c:772:1: enter_function: entry to 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: call_function: calling 'load_wrapper' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: return_function: returning to 'libcrun_container_restore_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:788:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:791:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:791:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:794:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:795:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:798:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:798:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:801:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:801:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:804:14: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:805:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:808:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:818:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:821:11: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:822:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:831:12: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:832:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:835:17: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:922:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:925:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:926:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:929:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:930:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:943:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:944:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:947:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:948:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/criu.c:960:15: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:963:43: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:964:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:967:10: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:978:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:980:32: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:980:32: danger: 'open(**_184.path, 0)' leaks here; was opened at [(44)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/43)
#  978|         if (value == CLONE_NEWPID && def->linux->namespaces[i]->path != NULL)
#  979|           {
#  980|->           inherit_new_pid_fd = open (def->linux->namespaces[i]->path, open_flags_for_inherit);
#  981|             if (UNLIKELY (inherit_new_pid_fd < 0))
#  982|               return crun_make_error (err, errno, "unable to open(): `%s`", def->linux->namespaces[i]->path);

Error: GCC_ANALYZER_WARNING (CWE-835): [#def385]
crun-1.21/src/libcrun/ebpf.c:294:10: warning[-Wanalyzer-infinite-loop]: infinite loop
crun-1.21/src/libcrun/ebpf.c:363:1: enter_function: entry to 'ebpf_attach_program'
#  292|         ret = bpf (BPF_PROG_QUERY, &attr, sizeof (attr));
#  293|       }
#  294|->   while (ret < 0 && errno == ENOSPC)
#  295|       ;
#  296|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def386]
crun-1.21/src/libcrun/error.c:413:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'level'
 branch_false: following 'false' branch...
crun-1.21/src/libcrun/error.c:385:24: branch_false: ...to here
crun-1.21/src/libcrun/error.c:394:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/error.c:397:3: branch_false: ...to here
crun-1.21/src/libcrun/error.c:413:3: danger: use of uninitialized value 'level' here
#  411|   
#  412|     yajl_gen_string (gen, YAJL_STR ("level"), strlen ("level"));
#  413|->   yajl_gen_string (gen, YAJL_STR (level), strlen (level));
#  414|   
#  415|     yajl_gen_string (gen, YAJL_STR ("time"), strlen ("time"));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def387]
crun-1.21/src/libcrun/handlers/../utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*(void *)p'
crun-1.21/src/libcrun/handlers/../utils.h:108:5: release_resource: first 'close' here
crun-1.21/src/libcrun/handlers/../utils.h:108:5: branch_true: following 'true' branch...
crun-1.21/src/libcrun/handlers/../utils.h:108:5: danger: second 'close' here; first 'close' was at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def388]
crun-1.21/src/libcrun/handlers/../utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-1.21/src/libcrun/handlers/krun.c:175:1: enter_function: entry to 'libkrun_configure_container'
crun-1.21/src/libcrun/handlers/krun.c:190:6: branch_true: following 'true' branch (when 'rootfs' is NULL)...
crun-1.21/src/libcrun/handlers/krun.c:199:6: branch_true: ...to here
crun-1.21/src/libcrun/handlers/krun.c:199:6: branch_true: following 'true' branch (when 'phase == 1')...
crun-1.21/src/libcrun/handlers/krun.c:201:26: branch_true: ...to here
crun-1.21/src/libcrun/handlers/krun.c:208:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:211:13: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:212:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:215:13: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:216:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:221:12: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:222:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:225:13: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:226:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:204:25: call_function: inlined call to 'cleanup_closep' from 'libkrun_configure_container'
 branch_true: ...to here
crun-1.21/src/libcrun/handlers/krun.c:204:25: call_function: inlined call to 'cleanup_closep' from 'libkrun_configure_container'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def389]
crun-1.21/src/libcrun/handlers/../utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rootfsfd_cleanup'
crun-1.21/src/libcrun/handlers/krun.c:175:1: enter_function: entry to 'libkrun_configure_container'
crun-1.21/src/libcrun/handlers/krun.c:190:6: branch_false: following 'false' branch (when 'rootfs' is non-NULL)...
crun-1.21/src/libcrun/handlers/krun.c:194:37: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:194:37: acquire_resource: opened here
crun-1.21/src/libcrun/handlers/krun.c:195:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/handlers/krun.c:199:6: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:185:21: call_function: inlined call to 'cleanup_closep' from 'libkrun_configure_container'
 branch_true: ...to here
crun-1.21/src/libcrun/handlers/krun.c:185:21: call_function: inlined call to 'cleanup_closep' from 'libkrun_configure_container'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def390]
crun-1.21/src/libcrun/handlers/krun.c:194:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(rootfs, 2621440)'
crun-1.21/src/libcrun/handlers/krun.c:190:6: branch_false: following 'false' branch (when 'rootfs' is non-NULL)...
crun-1.21/src/libcrun/handlers/krun.c:194:37: branch_false: ...to here
crun-1.21/src/libcrun/handlers/krun.c:194:37: acquire_resource: opened here
crun-1.21/src/libcrun/handlers/krun.c:194:37: danger: 'open(rootfs, 2621440)' leaks here; was opened at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  192|     else
#  193|       {
#  194|->       rootfsfd = rootfsfd_cleanup = open (rootfs, O_PATH | O_CLOEXEC);
#  195|         if (UNLIKELY (rootfsfd < 0))
#  196|           return crun_make_error (err, errno, "open `%s`", rootfs);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def391]
crun-1.21/src/libcrun/intelrdt.c:313:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 524289)'
crun-1.21/src/libcrun/intelrdt.c:303:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:306:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:307:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_false: following 'false' branch (when 'l3_cache_schema' is NULL)...
crun-1.21/src/libcrun/intelrdt.c:313:8: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:313:8: acquire_resource: opened here
crun-1.21/src/libcrun/intelrdt.c:313:8: danger: 'open(path, 524289)' leaks here; was opened at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  311|       l3_cache_schema = cleaned_l3_cache_schema = intelrdt_clean_l3_cache_schema (l3_cache_schema);
#  312|   
#  313|->   fd = open (path, O_WRONLY | O_CLOEXEC);
#  314|     if (UNLIKELY (fd < 0))
#  315|       return crun_make_error (err, errno, "open `%s`", path);

Error: CPPCHECK_WARNING (CWE-457): [#def392]
crun-1.21/src/libcrun/linux.c:3653: error[uninitvar]: Uninitialized variable: code
# 3651|         if (UNLIKELY (ret < 0))
# 3652|           return false;
# 3653|->       *error = code;
# 3654|       }
# 3655|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def393]
crun-1.21/src/libcrun/seccomp.c:462:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_rundir_dirfd(*container_44->context.state_root,  err)'
crun-1.21/src/libcrun/seccomp.c:573:1: enter_function: entry to 'store_seccomp_cache'
crun-1.21/src/libcrun/seccomp.c:581:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:584:7: call_function: inlined call to 'is_empty_string' from 'store_seccomp_cache'
crun-1.21/src/libcrun/seccomp.c:587:30: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:587:11: call_function: calling 'open_rundir_dirfd' from 'store_seccomp_cache'
crun-1.21/src/libcrun/seccomp.c:587:11: return_function: returning to 'store_seccomp_cache' from 'open_rundir_dirfd'
crun-1.21/src/libcrun/seccomp.c:462:7: danger: 'open_rundir_dirfd(*container_44->context.state_root,  err)' leaks here; was opened at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
#  460|   
#  461|     ret = libcrun_get_state_directory (&dir, state_root, NULL, err);
#  462|->   if (UNLIKELY (ret < 0))
#  463|       return ret;
#  464|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def394]
crun-1.21/src/libcrun/seccomp.c:462:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_rundir_dirfd(*container_50->context.state_root,  err)'
crun-1.21/src/libcrun/seccomp.c:860:1: enter_function: entry to 'libcrun_open_seccomp_bpf'
crun-1.21/src/libcrun/seccomp.c:869:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:872:11: call_function: calling 'open_rundir_dirfd' from 'libcrun_open_seccomp_bpf'
crun-1.21/src/libcrun/seccomp.c:872:11: return_function: returning to 'libcrun_open_seccomp_bpf' from 'open_rundir_dirfd'
crun-1.21/src/libcrun/seccomp.c:462:7: danger: 'open_rundir_dirfd(*container_50->context.state_root,  err)' leaks here; was opened at [(8)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/7)
#  460|   
#  461|     ret = libcrun_get_state_directory (&dir, state_root, NULL, err);
#  462|->   if (UNLIKELY (ret < 0))
#  463|       return ret;
#  464|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def395]
crun-1.21/src/libcrun/seccomp.c:465:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(dir, 2686976)'
crun-1.21/src/libcrun/seccomp.c:462:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:465:11: acquire_resource: opened here
crun-1.21/src/libcrun/seccomp.c:465:11: danger: 'open(dir, 2686976)' leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  463|       return ret;
#  464|   
#  465|->   dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
#  466|     if (UNLIKELY (dirfd < 0))
#  467|       return crun_make_error (err, errno, "open `%s`", dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def396]
crun-1.21/src/libcrun/seccomp.c:466:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor '<unknown>'
crun-1.21/src/libcrun/seccomp.c:462:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:465:11: acquire_resource: opened here
crun-1.21/src/libcrun/seccomp.c:466:6: danger: '<unknown>' leaks here; was opened at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  464|   
#  465|     dirfd = TEMP_FAILURE_RETRY (open (dir, O_PATH | O_DIRECTORY | O_CLOEXEC));
#  466|->   if (UNLIKELY (dirfd < 0))
#  467|       return crun_make_error (err, errno, "open `%s`", dir);
#  468|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def397]
crun-1.21/src/libcrun/seccomp.c:523:11: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(cache_dir_fd)'
crun-1.21/src/libcrun/seccomp.c:501:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:504:60: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:507:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:515:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:523:11: acquire_memory: allocated here
crun-1.21/src/libcrun/seccomp.c:523:11: danger: 'fdopendir(cache_dir_fd)' leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  521|         int dfd;
#  522|   
#  523|->       d = fdopendir (cache_dir_fd);
#  524|         if (d == NULL)
#  525|           return crun_make_error (err, errno, "cannot open seccomp cache directory");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def398]
crun-1.21/src/libcrun/seccomp.c:563:7: warning[-Wanalyzer-null-argument]: use of NULL 'entries' where non-null expected
crun-1.21/src/libcrun/seccomp.c:501:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:504:60: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:507:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:515:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:524:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:527:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:563:7: danger: argument 1 ('entries') NULL where non-null expected
#  561|           }
#  562|   
#  563|->       qsort (entries, n_entries, sizeof (struct cache_entry), compare_entries_by_atime);
#  564|   
#  565|         /* Attempt to delete half of them.  */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def399]
crun-1.21/src/libcrun/status.c:86:1: warning[-Wanalyzer-malloc-leak]: leak of 'root'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
#   84|   
#   85|     return 0;
#   86|-> }
#   87|   
#   88|   int

Error: GCC_ANALYZER_WARNING (CWE-775): [#def400]
crun-1.21/src/libcrun/status.c:147:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&pid_stat_file, 524288)'
crun-1.21/src/libcrun/status.c:692:1: enter_function: entry to 'libcrun_check_pid_valid'
crun-1.21/src/libcrun/status.c:698:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:701:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:701:9: call_function: calling 'read_pid_stat' from 'libcrun_check_pid_valid'
#  145|     sprintf (pid_stat_file, "/proc/%d/stat", pid);
#  146|   
#  147|->   fd = open (pid_stat_file, O_RDONLY | O_CLOEXEC);
#  148|     if (fd < 0)
#  149|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def401]
crun-1.21/src/libcrun/status.c:512:7: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(fd)'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:579:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:582:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:583:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:586:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:586:9: call_function: calling 'rmdirfd' from 'libcrun_container_delete_status'
#  510|     __attribute__ ((unused)) cleanup_close int fd_cleanup = fd;
#  511|   
#  512|->   d = fdopendir (fd);
#  513|     if (d == NULL)
#  514|       return crun_make_error (err, errno, "cannot open directory `%s`", namedir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def402]
crun-1.21/src/libcrun/status.c:578:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(dir, 2686976)'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:578:16: acquire_resource: opened here
crun-1.21/src/libcrun/status.c:578:16: danger: 'open(dir, 2686976)' leaks here; was opened at [(17)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/16)
#  576|       return ret;
#  577|   
#  578|->   rundir_dfd = TEMP_FAILURE_RETRY (open (dir, O_DIRECTORY | O_PATH | O_CLOEXEC));
#  579|     if (UNLIKELY (rundir_dfd < 0))
#  580|       return crun_make_error (err, errno, "cannot open run directory `%s`", dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def403]
crun-1.21/src/libcrun/status.c:599:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'rundir_dfd'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:578:16: acquire_resource: opened here
crun-1.21/src/libcrun/status.c:579:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/status.c:580:34: branch_true: ...to here
crun-1.21/src/libcrun/status.c:599:1: danger: 'rundir_dfd' leaks here; was opened at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#  597|   
#  598|     return 0;
#  599|-> }
#  600|   
#  601|   void

Error: GCC_ANALYZER_WARNING (CWE-401): [#def404]
crun-1.21/src/libcrun/status.c:631:9: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(root)'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: return_function: returning to 'libcrun_get_containers_list' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:628:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:631:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:631:9: acquire_memory: allocated here
crun-1.21/src/libcrun/status.c:631:9: danger: 'opendir(root)' leaks here; was allocated at [(15)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/14)
#  629|       return ret;
#  630|   
#  631|->   dir = opendir (root);
#  632|     if (UNLIKELY (dir == NULL))
#  633|       return crun_make_error (err, errno, "cannot opendir `%s`", root);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def405]
crun-1.21/src/libcrun/status.c:746:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 526336)'
crun-1.21/src/libcrun/status.c:727:1: enter_function: entry to 'libcrun_status_create_exec_fifo'
crun-1.21/src/libcrun/status.c:733:9: call_function: calling 'libcrun_get_state_directory' from 'libcrun_status_create_exec_fifo'
crun-1.21/src/libcrun/status.c:733:9: return_function: returning to 'libcrun_status_create_exec_fifo' from 'libcrun_get_state_directory'
crun-1.21/src/libcrun/status.c:734:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:737:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:738:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:741:3: branch_false: ...to here
crun-1.21/src/libcrun/status.c:743:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:746:8: branch_false: ...to here
crun-1.21/src/libcrun/status.c:746:8: acquire_resource: opened here
crun-1.21/src/libcrun/status.c:746:8: danger: 'open(fifo_path, 526336)' leaks here; was opened at [(28)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/27)
#  744|       return crun_make_error (err, errno, "mkfifo");
#  745|   
#  746|->   fd = open (fifo_path, O_NONBLOCK | O_CLOEXEC);
#  747|     if (UNLIKELY (fd < 0))
#  748|       return crun_make_error (err, errno, "cannot open pipe `%s`", fifo_path);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def406]
crun-1.21/src/libcrun/status.c:772:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(fifo_path, 524289)'
crun-1.21/src/libcrun/status.c:754:1: enter_function: entry to 'libcrun_status_write_exec_fifo'
crun-1.21/src/libcrun/status.c:764:9: call_function: calling 'libcrun_get_state_directory' from 'libcrun_status_write_exec_fifo'
crun-1.21/src/libcrun/status.c:764:9: return_function: returning to 'libcrun_status_write_exec_fifo' from 'libcrun_get_state_directory'
crun-1.21/src/libcrun/status.c:765:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:768:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:769:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:772:8: branch_false: ...to here
crun-1.21/src/libcrun/status.c:772:8: acquire_resource: opened here
crun-1.21/src/libcrun/status.c:772:8: danger: 'open(fifo_path, 524289)' leaks here; was opened at [(26)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/25)
#  770|       return ret;
#  771|   
#  772|->   fd = open (fifo_path, O_WRONLY | O_CLOEXEC);
#  773|     if (UNLIKELY (fd < 0))
#  774|       return crun_make_error (err, errno, "cannot open `%s`", fifo_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def407]
crun-1.21/src/libcrun/utils.c:2132:12: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(srcdirfd)'
crun-1.21/src/libcrun/utils.c:2132:12: acquire_memory: allocated here
crun-1.21/src/libcrun/utils.c:2132:12: danger: 'fdopendir(srcdirfd)' leaks here; was allocated at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
# 2130|     struct dirent *de;
# 2131|   
# 2132|->   dsrcfd = fdopendir (srcdirfd);
# 2133|     if (UNLIKELY (dsrcfd == NULL))
# 2134|       {

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def408]
crun-1.21/src/libcrun/utils.c:2135:7: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcdirfd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2135:7: release_resource: first 'close' here
crun-1.21/src/libcrun/utils.c:2135:7: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2135:7: danger: second 'close' here; first 'close' was at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 2133|     if (UNLIKELY (dsrcfd == NULL))
# 2134|       {
# 2135|->       TEMP_FAILURE_RETRY (close (srcdirfd));
# 2136|         return crun_make_error (err, errno, "cannot open directory `%s`", destname);
# 2137|       }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def409]
crun-1.21/src/libcrun/utils.c:2179:11: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destfd'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2162:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2165:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2166:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2169:17: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2169:17: call_function: calling 'copy_from_fd_to_fd' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2169:17: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_from_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2170:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2174:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2175:14: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2179:11: release_resource: first 'close' here
crun-1.21/src/libcrun/utils.c:2179:11: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2179:11: danger: second 'close' here; first 'close' was at [(30)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/29)
# 2177|   #endif
# 2178|   
# 2179|->           TEMP_FAILURE_RETRY (close (destfd));
# 2180|             destfd = -1;
# 2181|             break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def410]
crun-1.21/src/libcrun/utils.c:2213:17: warning[-Wanalyzer-null-argument]: use of NULL 'target_buf' where non-null expected
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2143:26: release_memory: 'target_buf' is NULL
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2209:17: call_function: calling 'safe_readlinkat' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2209:17: return_function: returning to 'copy_recursive_fd_to_fd' from 'safe_readlinkat'
crun-1.21/src/libcrun/utils.c:2210:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2213:17: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2213:17: release_memory: 'target_buf' is NULL
crun-1.21/src/libcrun/utils.c:2213:17: release_memory: 'target_buf' is NULL
crun-1.21/src/libcrun/utils.c:2213:17: danger: argument 1 ('target_buf') NULL where non-null expected
# 2211|               return ret;
# 2212|   
# 2213|->           ret = symlinkat (target_buf, destdirfd, de->d_name);
# 2214|             if (UNLIKELY (ret < 0))
# 2215|               return crun_make_error (err, errno, "create symlink `%s/%s`", destname, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def411]
crun-1.21/src/libcrun/utils.c:2517:9: warning[-Wanalyzer-null-argument]: use of NULL 'content' where non-null expected
crun-1.21/src/libcrun/utils.c:2503:22: release_memory: 'content' is NULL
crun-1.21/src/libcrun/utils.c:2510:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2516:3: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2517:9: danger: argument 1 ('content') NULL where non-null expected
# 2515|   
# 2516|     errno = 0;
# 2517|->   val = strtol (content, &endptr, 10);
# 2518|     if (UNLIKELY (errno))
# 2519|       return def_value;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def412]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'intelrdt_clean_l3_cache_schema(l3_cache_schema)'
crun-1.21/src/libcrun/intelrdt.c:295:1: enter_function: entry to 'resctl_update'
crun-1.21/src/libcrun/intelrdt.c:303:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:306:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:307:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_true: following 'true' branch (when 'l3_cache_schema' is non-NULL)...
crun-1.21/src/libcrun/intelrdt.c:310:26: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:310:7: branch_true: following 'true' branch...
crun-1.21/src/libcrun/intelrdt.c:311:49: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:311:49: call_function: calling 'intelrdt_clean_l3_cache_schema' from 'resctl_update'
crun-1.21/src/libcrun/intelrdt.c:311:49: return_function: returning to 'resctl_update' from 'intelrdt_clean_l3_cache_schema'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'intelrdt_clean_l3_cache_schema(l3_cache_schema)' leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def413]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(current_size + 1))'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2185:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2188:19: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2189:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2192:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2193:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2197:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2197:23: call_function: calling 'copy_xattr' from 'copy_recursive_fd_to_fd'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def414]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)(xattr_len + 1))'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2185:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2188:19: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2189:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2192:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2193:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2197:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2197:23: call_function: calling 'copy_xattr' from 'copy_recursive_fd_to_fd'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def415]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif)'
crun-1.21/src/libcrun/seccomp_notify.c:83:1: enter_function: entry to 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/seccomp_notify.c:92:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp_notify.c:95:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp_notify.c:95:15: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:95:15: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif)' leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def416]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif_resp)'
crun-1.21/src/libcrun/seccomp_notify.c:83:1: enter_function: entry to 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/seccomp_notify.c:92:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp_notify.c:95:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp_notify.c:95:15: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:95:15: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'xmalloc((long unsigned int)*(struct seccomp_notify_context_s *)<unknown>.sizes.seccomp_notif_resp)' leaks here; was allocated at [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def417]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc((n_parts_a + 1) * 8)'
crun-1.21/src/libcrun/intelrdt.c:233:1: enter_function: entry to 'resctl_create'
crun-1.21/src/libcrun/intelrdt.c:241:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:246:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:247:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:250:11: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:251:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_true: following 'true' branch (when 'l3_cache_schema' is non-NULL)...
crun-1.21/src/libcrun/intelrdt.c:254:26: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:7: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:259:27: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:259:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/intelrdt.c:269:12: call_function: calling 'validate_rdt_configuration' from 'resctl_create'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def418]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(128)'
crun-1.21/src/libcrun/utils.c:2568:1: enter_function: entry to 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2577:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2583:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2583:13: call_function: calling 'xmalloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2583:13: return_function: returning to 'read_dir_entries' from 'xmalloc'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'xmalloc(128)' leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def419]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(16)'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: return_function: returning to 'libcrun_get_containers_list' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:628:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:631:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:635:15: branch_false: ...to here
crun-1.21/src/libcrun/status.c:635:30: branch_true: following 'true' branch (when 'next' is non-NULL)...
crun-1.21/src/libcrun/status.c:638:26: branch_true: ...to here
crun-1.21/src/libcrun/status.c:642:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:645:52: branch_false: ...to here
crun-1.21/src/libcrun/status.c:646:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:649:16: branch_false: ...to here
crun-1.21/src/libcrun/status.c:650:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:655:10: branch_false: ...to here
crun-1.21/src/libcrun/status.c:655:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:661:24: branch_false: ...to here
crun-1.21/src/libcrun/status.c:661:24: call_function: calling 'xmalloc' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:661:24: return_function: returning to 'libcrun_get_containers_list' from 'xmalloc'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'xmalloc(16)' leaks here; was allocated at [(29)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/28)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def420]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(allocated + 1)'
crun-1.21/src/libcrun/utils.c:2501:1: enter_function: entry to 'read_file_as_long_or_default'
crun-1.21/src/libcrun/utils.c:2509:9: call_function: calling 'read_all_file' from 'read_file_as_long_or_default'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def421]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(get_page_size())'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2162:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2165:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2166:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2169:17: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2169:17: call_function: calling 'copy_from_fd_to_fd' from 'copy_recursive_fd_to_fd'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def422]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(in_size + 1)'
crun-1.21/src/libcrun/seccomp.c:837:1: enter_function: entry to 'libcrun_copy_seccomp'
crun-1.21/src/libcrun/seccomp.c:846:14: call_function: calling 'xmalloc' from 'libcrun_copy_seccomp'
crun-1.21/src/libcrun/seccomp.c:846:14: return_function: returning to 'libcrun_copy_seccomp' from 'xmalloc'
crun-1.21/src/libcrun/utils.h:65:7: danger: 'xmalloc(in_size + 1)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def423]
crun-1.21/src/libcrun/utils.h:65:7: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(88)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:297:7: branch_false: ...to here
crun-1.21/src/exec.c:298:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:300:27: branch_false: ...to here
crun-1.21/src/exec.c:303:23: call_function: calling ‘make_oci_process_user’ from ‘crun_command_exec’
crun-1.21/src/exec.c:303:23: return_function: returning to ‘crun_command_exec’ from ‘make_oci_process_user’
crun-1.21/src/exec.c:305:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:308:11: branch_false: ...to here
crun-1.21/src/exec.c:308:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:311:11: branch_false: ...to here
crun-1.21/src/exec.c:311:10: branch_true: following ‘true’ branch...
crun-1.21/src/exec.c:314:17: branch_true: ...to here
crun-1.21/src/exec.c:314:17: call_function: calling ‘xmalloc’ from ‘crun_command_exec’
crun-1.21/src/exec.c:314:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc’
crun-1.21/src/libcrun/utils.h:65:7: danger: ‘xmalloc(88)’ leaks here; was allocated at [(35)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/34)
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def424]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file("config.json", err)'
crun-1.21/src/libcrun/container.c:4321:1: enter_function: entry to 'libcrun_container_restore'
crun-1.21/src/libcrun/container.c:4337:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_restore'
crun-1.21/src/libcrun/container.c:4337:15: return_function: returning to 'libcrun_container_restore' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'libcrun_container_load_from_file("config.json", err)' leaks here; was allocated at [(10)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/9)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def425]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'libcrun_container_load_from_file(config_file,  err)'
crun-1.21/src/libcrun/container.c:4653:1: enter_function: entry to 'libcrun_container_update_intel_rdt'
crun-1.21/src/libcrun/container.c:4661:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4664:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4665:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4668:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4668:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_update_intel_rdt'
crun-1.21/src/libcrun/container.c:4668:15: return_function: returning to 'libcrun_container_update_intel_rdt' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'libcrun_container_load_from_file(config_file,  err)' leaks here; was allocated at [(14)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/13)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def426]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'make_container(runtime_spec_schema_config_schema_parse_file(path, 0, & oci_error), path, 0)'
crun-1.21/src/libcrun/container.c:4653:1: enter_function: entry to 'libcrun_container_update_intel_rdt'
crun-1.21/src/libcrun/container.c:4661:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4664:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4665:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4668:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4668:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_update_intel_rdt'
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def427]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0((num_mount_options + 1) * 8)'
crun-1.21/src/libcrun/container.c:4076:1: enter_function: entry to 'retrieve_mount_options'
crun-1.21/src/libcrun/container.c:4089:28: call_function: calling 'xmalloc0' from 'retrieve_mount_options'
crun-1.21/src/libcrun/container.c:4089:28: return_function: returning to 'retrieve_mount_options' from 'xmalloc0'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'xmalloc0((num_mount_options + 1) * 8)' leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def428]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(120)'
crun-1.21/src/libcrun/container.c:3866:1: enter_function: entry to 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3880:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3883:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3883:9: call_function: calling 'read_container_config_from_state' from 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3883:9: return_function: returning to 'libcrun_container_update' from 'read_container_config_from_state'
crun-1.21/src/libcrun/container.c:3884:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3887:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3892:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3895:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3896:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3899:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3900:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3906:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3906:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3909:62: call_function: calling 'xmalloc0' from 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3909:62: return_function: returning to 'libcrun_container_update' from 'xmalloc0'
crun-1.21/src/libcrun/container.c:3910:61: call_function: calling 'xmalloc0' from 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3910:61: return_function: returning to 'libcrun_container_update' from 'xmalloc0'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'xmalloc0(120)' leaks here; was allocated at [(33)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/32)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def429]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(144)'
crun-1.21/src/libcrun/container.c:4097:1: enter_function: entry to 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: call_function: calling 'xmalloc0' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: return_function: returning to 'libcrun_container_get_features' from 'xmalloc0'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'xmalloc0(144)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(176)'
crun-1.21/src/libcrun/container.c:3866:1: enter_function: entry to 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3880:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3883:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3883:9: call_function: calling 'read_container_config_from_state' from 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3883:9: return_function: returning to 'libcrun_container_update' from 'read_container_config_from_state'
crun-1.21/src/libcrun/container.c:3884:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3887:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3892:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3895:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3896:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3899:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3900:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3906:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3906:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3909:62: call_function: calling 'xmalloc0' from 'libcrun_container_update'
crun-1.21/src/libcrun/container.c:3909:62: return_function: returning to 'libcrun_container_update' from 'xmalloc0'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'xmalloc0(176)' leaks here; was allocated at [(28)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/27)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def431]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(48)'
crun-1.21/src/libcrun/seccomp_notify.c:83:1: enter_function: entry to 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/seccomp_notify.c:92:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp_notify.c:95:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp_notify.c:95:15: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:95:15: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/seccomp_notify.c:102:18: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:102:18: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/utils.h:74:7: danger: 'xmalloc0(48)' leaks here; was allocated at [(21)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/20)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def432]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of ‘make_oci_process_user(exec_options.user)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:297:7: branch_false: ...to here
crun-1.21/src/exec.c:298:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:300:27: branch_false: ...to here
crun-1.21/src/exec.c:303:23: call_function: calling ‘make_oci_process_user’ from ‘crun_command_exec’
crun-1.21/src/exec.c:303:23: return_function: returning to ‘crun_command_exec’ from ‘make_oci_process_user’
crun-1.21/src/libcrun/utils.h:74:7: danger: ‘make_oci_process_user(exec_options.user)’ leaks here; was allocated at [(26)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/25)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0((long unsigned int)(argc + 1) * 8)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/libcrun/utils.h:74:7: danger: ‘xmalloc0((long unsigned int)(argc + 1) * 8)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
crun-1.21/src/libcrun/utils.h:74:7: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(56)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:297:7: branch_false: ...to here
crun-1.21/src/exec.c:298:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:300:27: branch_false: ...to here
crun-1.21/src/exec.c:303:23: call_function: calling ‘make_oci_process_user’ from ‘crun_command_exec’
#   72|   {
#   73|     void *res = calloc (1, size);
#   74|->   if (UNLIKELY (res == NULL))
#   75|       OOM ();
#   76|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def435]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(*pids, (*n_pids + n_new_pids + 1) * 4)'
crun-1.21/src/libcrun/cgroup-utils.c:992:1: enter_function: entry to 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1002:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: call_function: calling 'libcrun_cgroup_pause_unpause_path' from 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: return_function: returning to 'libcrun_migrate_all_pids_to_cgroup' from 'libcrun_cgroup_pause_unpause_path'
crun-1.21/src/libcrun/cgroup-utils.c:1006:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: call_function: calling 'libcrun_cgroup_read_pids_from_path' from 'libcrun_migrate_all_pids_to_cgroup'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(buffer, (long unsigned int)(current_size + 1))'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2185:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2188:19: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2189:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2192:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2193:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2197:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2197:23: call_function: calling 'copy_xattr' from 'copy_recursive_fd_to_fd'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def437]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries,  entries_size * 16)'
crun-1.21/src/libcrun/utils.c:2568:1: enter_function: entry to 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2577:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2583:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2583:13: call_function: calling 'xmalloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2583:13: return_function: returning to 'read_dir_entries' from 'xmalloc'
crun-1.21/src/libcrun/utils.c:2584:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2586:19: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2588:10: branch_false: following 'false' branch (when 'n_entries != entries_size')...
crun-1.21/src/libcrun/utils.c:2593:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2593:30: call_function: calling 'xstrdup' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2593:30: return_function: returning to 'read_dir_entries' from 'xstrdup'
crun-1.21/src/libcrun/utils.c:2584:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2586:19: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2588:10: branch_true: following 'true' branch (when 'n_entries == entries_size')...
crun-1.21/src/libcrun/utils.c:2590:11: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2591:21: call_function: calling 'xrealloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2591:21: return_function: returning to 'read_dir_entries' from 'xrealloc'
crun-1.21/src/libcrun/utils.h:83:7: danger: 'xrealloc(entries,  entries_size * 16)' leaks here; was allocated at [(26)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/25)
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def438]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 8)'
crun-1.21/src/libcrun/utils.c:2568:1: enter_function: entry to 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2577:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2583:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2583:13: call_function: calling 'xmalloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2583:13: return_function: returning to 'read_dir_entries' from 'xmalloc'
crun-1.21/src/libcrun/utils.c:2595:13: call_function: calling 'xrealloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2595:13: return_function: returning to 'read_dir_entries' from 'xrealloc'
crun-1.21/src/libcrun/utils.h:83:7: danger: 'xrealloc(entries, (n_entries + 1) * 8)' leaks here; was allocated at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def439]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(entries, (n_entries + 1) * 88)'
crun-1.21/src/libcrun/seccomp.c:493:1: enter_function: entry to 'evict_cache'
crun-1.21/src/libcrun/seccomp.c:501:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:504:60: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:507:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:515:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:524:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:527:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:530:14: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:532:15: branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:555:25: call_function: calling 'xrealloc' from 'evict_cache'
crun-1.21/src/libcrun/seccomp.c:555:25: return_function: returning to 'evict_cache' from 'xrealloc'
crun-1.21/src/libcrun/utils.h:83:7: danger: 'xrealloc(entries, (n_entries + 1) * 88)' leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def440]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(log,  log_size)'
crun-1.21/src/libcrun/ebpf.c:475:1: enter_function: entry to 'libcrun_ebpf_load'
crun-1.21/src/libcrun/ebpf.c:504:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/src/libcrun/ebpf.c:511:13: call_function: calling 'xrealloc' from 'libcrun_ebpf_load'
crun-1.21/src/libcrun/ebpf.c:511:13: return_function: returning to 'libcrun_ebpf_load' from 'xrealloc'
crun-1.21/src/libcrun/utils.h:83:7: danger: 'xrealloc(log,  log_size)' leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5)
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def441]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(mask,  new_mask_size)'
crun-1.21/src/libcrun/utils.c:2602:1: enter_function: entry to 'cpuset_string_to_bitmask'
crun-1.21/src/libcrun/utils.c:2609:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2613:11: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2613:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2616:21: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2617:10: branch_false: following 'false' branch (when 'start_range >= 0')...
crun-1.21/src/libcrun/utils.c:2620:7: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2640:10: branch_false: following 'false' branch (when 'end_range <= 1048576')...
crun-1.21/src/libcrun/utils.c:2643:36: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2643:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2645:34: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2646:18: call_function: calling 'xrealloc' from 'cpuset_string_to_bitmask'
crun-1.21/src/libcrun/utils.c:2646:18: return_function: returning to 'cpuset_string_to_bitmask' from 'xrealloc'
crun-1.21/src/libcrun/utils.h:83:7: danger: 'xrealloc(mask,  new_mask_size)' leaks here; was allocated at [(14)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/13)
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def442]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(progs,  cur_size * 4)'
crun-1.21/src/libcrun/ebpf.c:363:1: enter_function: entry to 'ebpf_attach_program'
crun-1.21/src/libcrun/ebpf.c:387:13: call_function: calling 'read_all_progs' from 'ebpf_attach_program'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def443]
crun-1.21/src/libcrun/utils.h:83:7: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(tmp_buf, (long unsigned int)buf_size)'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2209:17: call_function: calling 'safe_readlinkat' from 'copy_recursive_fd_to_fd'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def444]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&controllers'
crun-1.21/src/libcrun/cgroup-resources.c:1371:1: enter_function: entry to 'update_cgroup_resources'
crun-1.21/src/libcrun/cgroup-resources.c:1381:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: following 'false' branch (when 'path' is non-NULL)...
crun-1.21/src/libcrun/cgroup-resources.c:1406:3: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1409:14: call_function: calling 'update_cgroup_v2_resources' from 'update_cgroup_resources'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def445]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of '*(void **)&target_buf'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2185:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2188:19: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2189:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2192:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2193:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2197:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2198:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2202:17: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2202:17: call_function: calling 'copy_recursive_fd_to_fd' from 'copy_recursive_fd_to_fd'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def446]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'buffer'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2185:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2188:19: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2189:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2192:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2193:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2197:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2197:23: call_function: calling 'copy_xattr' from 'copy_recursive_fd_to_fd'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def447]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'entries'
crun-1.21/src/libcrun/seccomp.c:493:1: enter_function: entry to 'evict_cache'
crun-1.21/src/libcrun/seccomp.c:501:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:504:60: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:507:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:515:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:524:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:527:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:530:14: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:532:15: branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:555:25: call_function: passing freed pointer 'entries' in call to 'xrealloc' from 'evict_cache'
crun-1.21/src/libcrun/seccomp.c:555:25: return_function: returning to 'evict_cache' from 'xrealloc'
crun-1.21/src/libcrun/seccomp.c:518:24: call_function: inlined call to 'cleanup_dirp' from 'evict_cache'
crun-1.21/src/libcrun/seccomp.c:517:40: call_function: inlined call to 'cleanup_freep' from 'evict_cache'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def448]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'log'
crun-1.21/src/libcrun/ebpf.c:475:1: enter_function: entry to 'libcrun_ebpf_load'
crun-1.21/src/libcrun/ebpf.c:504:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/src/libcrun/ebpf.c:511:13: call_function: passing freed pointer 'log' in call to 'xrealloc' from 'libcrun_ebpf_load'
crun-1.21/src/libcrun/ebpf.c:511:13: return_function: returning to 'libcrun_ebpf_load' from 'xrealloc'
crun-1.21/src/libcrun/ebpf.c:507:26: call_function: inlined call to 'cleanup_freep' from 'libcrun_ebpf_load'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def449]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'mask'
crun-1.21/src/libcrun/utils.c:2602:1: enter_function: entry to 'cpuset_string_to_bitmask'
crun-1.21/src/libcrun/utils.c:2609:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2613:11: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2613:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2616:21: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2617:10: branch_false: following 'false' branch (when 'start_range >= 0')...
crun-1.21/src/libcrun/utils.c:2620:7: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2640:10: branch_false: following 'false' branch (when 'end_range <= 1048576')...
crun-1.21/src/libcrun/utils.c:2643:36: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2646:18: call_function: passing freed pointer 'mask' in call to 'xrealloc' from 'cpuset_string_to_bitmask'
crun-1.21/src/libcrun/utils.c:2646:18: return_function: returning to 'cpuset_string_to_bitmask' from 'xrealloc'
crun-1.21/src/libcrun/utils.c:2604:22: call_function: inlined call to 'cleanup_freep' from 'cpuset_string_to_bitmask'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def450]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'progs'
crun-1.21/src/libcrun/ebpf.c:363:1: enter_function: entry to 'ebpf_attach_program'
crun-1.21/src/libcrun/ebpf.c:381:30: release_memory: first 'free' here
crun-1.21/src/libcrun/ebpf.c:387:13: call_function: calling 'read_all_progs' from 'ebpf_attach_program'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def451]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-'free' of 'tmp_buf'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2143:26: release_memory: first 'free' here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2209:17: call_function: calling 'safe_readlinkat' from 'copy_recursive_fd_to_fd'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def452]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-double-free]: double-‘free’ of ‘bundle_cleanup’
crun-1.21/src/restore.c:159:22: release_memory: first ‘free’ here
crun-1.21/src/restore.c:187:6: branch_false: following ‘false’ branch...
crun-1.21/src/restore.c:190:3: branch_false: ...to here
crun-1.21/src/restore.c:192:6: branch_true: following ‘true’ branch...
crun-1.21/src/restore.c:196:14: branch_true: ...to here
crun-1.21/src/restore.c:197:10: branch_true: following ‘true’ branch...
crun-1.21/src/restore.c:198:9: branch_true: ...to here
crun-1.21/src/restore.c:158:22: call_function: inlined call to ‘cleanup_freep’ from ‘crun_command_restore’
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def453]
crun-1.21/src/libcrun/utils.h:92:3: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-1.21/src/libcrun/container.c:4321:1: enter_function: entry to 'libcrun_container_restore'
crun-1.21/src/libcrun/container.c:4337:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_restore'
crun-1.21/src/libcrun/container.c:4337:15: return_function: returning to 'libcrun_container_restore' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:577:22: call_function: inlined call to 'cleanup_freep' from 'libcrun_container_load_from_file'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def454]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*(void *)p'
crun-1.21/src/libcrun/utils.h:108:5: release_resource: first 'close' here
crun-1.21/src/libcrun/utils.h:108:5: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.h:108:5: danger: second 'close' here; first 'close' was at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def455]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'cfd'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:579:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:582:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:583:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:586:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:586:9: call_function: calling 'rmdirfd' from 'libcrun_container_delete_status'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def456]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'console_socket_fd'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3791:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3795:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3795:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3801:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3802:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3805:11: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3805:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3808:49: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3809:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3811:17: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3808:29: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_exec_with_options'
 branch_true: ...to here
crun-1.21/src/libcrun/container.c:3808:29: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_exec_with_options'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def457]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'destdirfd'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_true: following 'true' branch...
 branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2129:20: call_function: inlined call to 'cleanup_dirp' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2128:21: call_function: inlined call to 'cleanup_closep' from 'copy_recursive_fd_to_fd'
 branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2128:21: call_function: inlined call to 'cleanup_closep' from 'copy_recursive_fd_to_fd'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def458]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dirfd'
crun-1.21/src/libcrun/seccomp.c:860:1: enter_function: entry to 'libcrun_open_seccomp_bpf'
crun-1.21/src/libcrun/seccomp.c:869:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:872:11: call_function: calling 'open_rundir_dirfd' from 'libcrun_open_seccomp_bpf'
crun-1.21/src/libcrun/seccomp.c:872:11: return_function: returning to 'libcrun_open_seccomp_bpf' from 'open_rundir_dirfd'
crun-1.21/src/libcrun/seccomp.c:873:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:877:40: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:862:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_open_seccomp_bpf'
 branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:862:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_open_seccomp_bpf'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def459]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-1.21/src/libcrun/intelrdt.c:295:1: enter_function: entry to 'resctl_update'
crun-1.21/src/libcrun/intelrdt.c:303:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:306:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:307:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:310:6: branch_true: following 'true' branch (when 'l3_cache_schema' is non-NULL)...
crun-1.21/src/libcrun/intelrdt.c:310:26: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:310:7: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:313:8: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:313:8: acquire_resource: opened here
crun-1.21/src/libcrun/intelrdt.c:314:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:317:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:299:21: call_function: inlined call to 'cleanup_closep' from 'resctl_update'
 branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:299:21: call_function: inlined call to 'cleanup_closep' from 'resctl_update'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def460]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd_cleanup'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:579:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:582:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:583:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:586:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:586:9: call_function: calling 'rmdirfd' from 'libcrun_container_delete_status'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def461]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'image_fd'
crun-1.21/src/libcrun/criu.c:409:1: enter_function: entry to 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: call_function: calling 'load_wrapper' from 'libcrun_container_checkpoint_linux_criu'
crun-1.21/src/libcrun/criu.c:423:9: return_function: returning to 'libcrun_container_checkpoint_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:424:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:427:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:427:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:447:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:448:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:451:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:451:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:454:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:454:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:457:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:461:14: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:462:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:465:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:515:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:536:9: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:417:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_checkpoint_linux_criu'
 branch_true: ...to here
crun-1.21/src/libcrun/criu.c:417:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_checkpoint_linux_criu'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def462]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.21/src/libcrun/seccomp.c:200:1: enter_function: entry to 'libcrun_apply_seccomp'
crun-1.21/src/libcrun/seccomp.c:214:6: branch_false: following 'false' branch (when 'infd >= 0')...
crun-1.21/src/libcrun/seccomp.c:217:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:217:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:221:6: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:242:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:245:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:248:6: branch_true: following 'true' branch (when 'listener_receiver_fd >= 0')...
crun-1.21/src/libcrun/seccomp.c:250:25: branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:268:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/seccomp.c:269:38: branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:250:25: call_function: inlined call to 'cleanup_closep' from 'libcrun_apply_seccomp'
 branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:250:25: call_function: inlined call to 'cleanup_closep' from 'libcrun_apply_seccomp'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def463]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'root_fd'
crun-1.21/src/libcrun/criu.c:697:1: enter_function: entry to 'prepare_restore_mounts'
crun-1.21/src/libcrun/criu.c:702:15: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:704:20: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:712:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:717:19: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:719:30: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:746:17: acquire_resource: opened here
crun-1.21/src/libcrun/criu.c:747:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:750:10: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:755:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:706:25: call_function: inlined call to 'cleanup_closep' from 'prepare_restore_mounts'
 branch_true: ...to here
crun-1.21/src/libcrun/criu.c:706:25: call_function: inlined call to 'cleanup_closep' from 'prepare_restore_mounts'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def464]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'rundir_dfd'
crun-1.21/src/libcrun/status.c:563:1: enter_function: entry to 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:571:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:574:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:574:9: call_function: calling 'get_run_directory' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:574:9: return_function: returning to 'libcrun_container_delete_status' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:575:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/status.c:578:16: acquire_resource: opened here
crun-1.21/src/libcrun/status.c:579:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:582:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:583:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/status.c:584:34: branch_true: ...to here
crun-1.21/src/libcrun/status.c:567:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_delete_status'
crun-1.21/src/libcrun/status.c:566:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_delete_status'
 branch_true: ...to here
crun-1.21/src/libcrun/status.c:566:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_container_delete_status'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def465]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'srcfd'
crun-1.21/src/libcrun/utils.c:2126:1: enter_function: entry to 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2133:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2139:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2139:31: branch_true: following 'true' branch (when 'de' is non-NULL)...
crun-1.21/src/libcrun/utils.c:2141:25: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2151:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2154:13: call_function: calling 'copy_rec_stat_file_at' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2154:13: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_rec_stat_file_at'
crun-1.21/src/libcrun/utils.c:2155:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2158:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2162:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2165:20: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2166:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2169:17: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2169:17: call_function: calling 'copy_from_fd_to_fd' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2169:17: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_from_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2170:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2174:23: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2174:23: call_function: calling 'copy_xattr' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2174:23: return_function: returning to 'copy_recursive_fd_to_fd' from 'copy_xattr'
crun-1.21/src/libcrun/utils.c:2175:14: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2229:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2239:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2240:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2143:26: call_function: inlined call to 'cleanup_freep' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2142:25: call_function: inlined call to 'cleanup_closep' from 'copy_recursive_fd_to_fd'
crun-1.21/src/libcrun/utils.c:2141:25: call_function: inlined call to 'cleanup_closep' from 'copy_recursive_fd_to_fd'
 branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2141:25: call_function: inlined call to 'cleanup_closep' from 'copy_recursive_fd_to_fd'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def466]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'tasksfd'
crun-1.21/src/libcrun/cgroup-utils.c:992:1: enter_function: entry to 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1002:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: call_function: calling 'libcrun_cgroup_pause_unpause_path' from 'libcrun_migrate_all_pids_to_cgroup'
crun-1.21/src/libcrun/cgroup-utils.c:1005:9: return_function: returning to 'libcrun_migrate_all_pids_to_cgroup' from 'libcrun_cgroup_pause_unpause_path'
crun-1.21/src/libcrun/cgroup-utils.c:1006:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1009:9: call_function: calling 'libcrun_cgroup_read_pids_from_path' from 'libcrun_migrate_all_pids_to_cgroup'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def467]
crun-1.21/src/libcrun/utils.h:108:5: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'wfd'
crun-1.21/src/libcrun/cgroup-resources.c:1371:1: enter_function: entry to 'update_cgroup_resources'
crun-1.21/src/libcrun/cgroup-resources.c:1381:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: following 'false' branch (when 'path' is non-NULL)...
crun-1.21/src/libcrun/cgroup-resources.c:1406:3: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1409:14: call_function: calling 'update_cgroup_v2_resources' from 'update_cgroup_resources'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def468]
crun-1.21/src/libcrun/utils.h:109:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'ret'
crun-1.21/src/libcrun/terminal.c:95:1: enter_function: entry to 'libcrun_set_stdio'
crun-1.21/src/libcrun/terminal.c:100:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:103:15: branch_true: following 'true' branch (when 'i != 3')...
crun-1.21/src/libcrun/terminal.c:105:13: branch_true: ...to here
crun-1.21/src/libcrun/terminal.c:105:13: acquire_resource: opened here
crun-1.21/src/libcrun/terminal.c:106:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/terminal.c:103:22: branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:103:15: branch_true: following 'true' branch (when 'i != 3')...
crun-1.21/src/libcrun/terminal.c:105:13: branch_true: ...to here
crun-1.21/src/libcrun/terminal.c:106:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/terminal.c:103:22: branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:98:21: call_function: inlined call to 'cleanup_closep' from 'libcrun_set_stdio'
 branch_true: ...to here
crun-1.21/src/libcrun/utils.h:109:1: danger: 'ret' leaks here; was opened at [(12)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/11)
#  107|     if (*pp >= 0)
#  108|       TEMP_FAILURE_RETRY (close (*pp));
#  109|-> }
#  110|   
#  111|   static inline void

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def469]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*fd'
crun-1.21/src/libcrun/container.c:4272:1: enter_function: entry to 'restore_proxy_process'
crun-1.21/src/libcrun/container.c:4282:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4285:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4285:3: call_function: calling 'close_and_reset' from 'restore_proxy_process'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def470]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'memfd'
crun-1.21/src/libcrun/seccomp.c:200:1: enter_function: entry to 'libcrun_apply_seccomp'
crun-1.21/src/libcrun/seccomp.c:214:6: branch_false: following 'false' branch (when 'infd >= 0')...
crun-1.21/src/libcrun/seccomp.c:217:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:217:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:221:6: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:242:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:245:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:248:6: branch_true: following 'true' branch (when 'listener_receiver_fd >= 0')...
crun-1.21/src/libcrun/seccomp.c:250:25: branch_true: ...to here
crun-1.21/src/libcrun/seccomp.c:261:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:267:13: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:268:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:271:13: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:273:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp.c:277:7: branch_false: ...to here
crun-1.21/src/libcrun/seccomp.c:277:7: call_function: calling 'close_and_reset' from 'libcrun_apply_seccomp'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def471]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'own_seccomp_receiver_fd'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3679:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3681:13: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3681:13: call_function: calling 'get_seccomp_receiver_fd' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3681:13: return_function: returning to 'libcrun_container_exec_with_options' from 'get_seccomp_receiver_fd'
crun-1.21/src/libcrun/container.c:3684:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3688:25: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3740:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3742:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3748:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3751:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3756:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3791:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3830:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3835:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3837:31: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3838:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3841:17: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3841:17: call_function: calling 'close_and_reset' from 'libcrun_container_exec_with_options'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def472]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_fd'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3788:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3789:5: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3789:5: call_function: calling 'close_and_reset' from 'libcrun_container_exec_with_options'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def473]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'seccomp_receiver_fd'
crun-1.21/src/libcrun/container.c:3374:1: enter_function: entry to 'exec_process_entrypoint'
crun-1.21/src/libcrun/container.c:3407:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3410:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3411:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3414:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3443:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3446:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3447:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3450:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3450:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3477:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3480:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3480:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3482:26: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3494:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3497:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3498:7: call_function: calling 'close_and_reset' from 'exec_process_entrypoint'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def474]
crun-1.21/src/libcrun/utils.h:210:13: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'terminal_fd'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3756:9: call_function: calling 'initialize_security' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3756:9: return_function: returning to 'libcrun_container_exec_with_options' from 'initialize_security'
crun-1.21/src/libcrun/container.c:3757:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3760:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3761:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3765:40: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3766:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3770:6: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3770:6: branch_false: following 'false' branch...
 branch_false: ...to here
crun-1.21/src/libcrun/container.c:3791:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3795:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3795:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3801:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3802:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3805:11: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3805:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3808:49: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3809:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3811:17: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3812:14: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3814:11: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3814:11: call_function: calling 'close_and_reset' from 'libcrun_container_exec_with_options'
#  208|     if (*fd >= 0)
#  209|       {
#  210|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  211|         if (LIKELY (ret == 0))
#  212|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def475]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup("/run/crun")'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def476]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup("1.0.0")'
crun-1.21/src/libcrun/container.c:4097:1: enter_function: entry to 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: call_function: calling 'xmalloc0' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: return_function: returning to 'libcrun_container_get_features' from 'xmalloc0'
crun-1.21/src/libcrun/container.c:4112:30: call_function: calling 'xstrdup' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4112:30: return_function: returning to 'libcrun_container_get_features' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup("1.0.0")' leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def477]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup("1.1.0+dev")'
crun-1.21/src/libcrun/container.c:4097:1: enter_function: entry to 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: call_function: calling 'xmalloc0' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4109:11: return_function: returning to 'libcrun_container_get_features' from 'xmalloc0'
crun-1.21/src/libcrun/container.c:4112:30: call_function: calling 'xstrdup' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4112:30: return_function: returning to 'libcrun_container_get_features' from 'xstrdup'
crun-1.21/src/libcrun/container.c:4113:30: call_function: calling 'xstrdup' from 'libcrun_container_get_features'
crun-1.21/src/libcrun/container.c:4113:30: return_function: returning to 'libcrun_container_get_features' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup("1.1.0+dev")' leaks here; was allocated at [(18)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/17)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def478]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&*<unknown>.d_name)'
crun-1.21/src/libcrun/utils.c:2568:1: enter_function: entry to 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2577:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2583:13: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2583:13: call_function: calling 'xmalloc' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2583:13: return_function: returning to 'read_dir_entries' from 'xmalloc'
crun-1.21/src/libcrun/utils.c:2584:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/utils.c:2586:19: branch_true: ...to here
crun-1.21/src/libcrun/utils.c:2586:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/utils.c:2588:10: branch_false: following 'false' branch (when 'n_entries != entries_size')...
crun-1.21/src/libcrun/utils.c:2593:15: branch_false: ...to here
crun-1.21/src/libcrun/utils.c:2593:30: call_function: calling 'xstrdup' from 'read_dir_entries'
crun-1.21/src/libcrun/utils.c:2593:30: return_function: returning to 'read_dir_entries' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(&*<unknown>.d_name)' leaks here; was allocated at [(19)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/18)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def479]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&*next.d_name)'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: return_function: returning to 'libcrun_get_containers_list' from 'get_run_directory'
crun-1.21/src/libcrun/status.c:628:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:631:9: branch_false: ...to here
crun-1.21/src/libcrun/status.c:632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:635:15: branch_false: ...to here
crun-1.21/src/libcrun/status.c:635:30: branch_true: following 'true' branch (when 'next' is non-NULL)...
crun-1.21/src/libcrun/status.c:638:26: branch_true: ...to here
crun-1.21/src/libcrun/status.c:642:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:645:52: branch_false: ...to here
crun-1.21/src/libcrun/status.c:646:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:649:16: branch_false: ...to here
crun-1.21/src/libcrun/status.c:650:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:655:10: branch_false: ...to here
crun-1.21/src/libcrun/status.c:655:10: branch_false: following 'false' branch...
crun-1.21/src/libcrun/status.c:661:24: branch_false: ...to here
crun-1.21/src/libcrun/status.c:661:24: call_function: calling 'xmalloc' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:661:24: return_function: returning to 'libcrun_get_containers_list' from 'xmalloc'
crun-1.21/src/libcrun/status.c:662:30: call_function: calling 'xstrdup' from 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:662:30: return_function: returning to 'libcrun_get_containers_list' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(&*next.d_name)' leaks here; was allocated at [(36)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/35)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def480]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(&buf)'
crun-1.21/src/libcrun/terminal.c:40:1: enter_function: entry to 'libcrun_new_terminal'
crun-1.21/src/libcrun/terminal.c:45:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/terminal.c:48:9: branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:49:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/terminal.c:52:9: branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:53:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/terminal.c:56:10: branch_false: ...to here
crun-1.21/src/libcrun/terminal.c:56:10: call_function: calling 'xstrdup' from 'libcrun_new_terminal'
crun-1.21/src/libcrun/terminal.c:56:10: return_function: returning to 'libcrun_new_terminal' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(&buf)' leaks here; was allocated at [(12)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/11)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def481]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*<unknown>.name)'
crun-1.21/src/libcrun/container.c:4076:1: enter_function: entry to 'retrieve_mount_options'
crun-1.21/src/libcrun/container.c:4089:28: call_function: calling 'xmalloc0' from 'retrieve_mount_options'
crun-1.21/src/libcrun/container.c:4089:28: return_function: returning to 'retrieve_mount_options' from 'xmalloc0'
crun-1.21/src/libcrun/container.c:4092:22: branch_true: following 'true' branch (when 'num_mount_options > i')...
crun-1.21/src/libcrun/container.c:4093:60: branch_true: ...to here
crun-1.21/src/libcrun/container.c:4093:33: call_function: calling 'xstrdup' from 'retrieve_mount_options'
crun-1.21/src/libcrun/container.c:4093:33: return_function: returning to 'retrieve_mount_options' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(*<unknown>.name)' leaks here; was allocated at [(13)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/12)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def482]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_70->process.selinux_label)'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3740:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3742:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3742:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3743:34: call_function: calling 'xstrdup' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3743:34: return_function: returning to 'libcrun_container_exec_with_options' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(*_70->process.selinux_label)' leaks here; was allocated at [(58)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/57)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def483]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*_76->process.apparmor_profile)'
crun-1.21/src/libcrun/container.c:3594:1: enter_function: entry to 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3623:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3626:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3627:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3631:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3632:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3635:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3636:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3639:15: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3639:15: call_function: calling 'libcrun_container_load_from_file' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3639:15: return_function: returning to 'libcrun_container_exec_with_options' from 'libcrun_container_load_from_file'
crun-1.21/src/libcrun/container.c:3640:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3643:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3645:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3651:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3654:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3649:57: call_function: inlined call to 'cgroup_status_freep' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3658:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3661:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3666:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3669:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3670:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3673:3: call_function: inlined call to 'libcrun_seccomp_gen_ctx_init' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3676:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3679:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3688:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3691:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3691:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3728:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3729:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3732:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3733:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3735:13: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3740:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3742:11: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3745:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3746:37: call_function: calling 'xstrdup' from 'libcrun_container_exec_with_options'
crun-1.21/src/libcrun/container.c:3746:37: return_function: returning to 'libcrun_container_exec_with_options' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(*_76->process.apparmor_profile)' leaks here; was allocated at [(58)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/57)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def484]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*process_199(D)->args)'
crun-1.21/src/libcrun/container.c:3374:1: enter_function: entry to 'exec_process_entrypoint'
crun-1.21/src/libcrun/container.c:3407:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3410:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3411:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3414:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3443:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3446:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3447:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3450:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3450:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3477:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3480:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3502:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3505:9: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3505:9: call_function: calling 'maybe_chown_std_streams' from 'exec_process_entrypoint'
crun-1.21/src/libcrun/container.c:3505:9: return_function: returning to 'exec_process_entrypoint' from 'maybe_chown_std_streams'
crun-1.21/src/libcrun/container.c:3506:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3509:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3515:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:3518:7: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3518:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3520:60: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3521:10: branch_true: following 'true' branch...
crun-1.21/src/libcrun/container.c:3523:14: branch_true: ...to here
crun-1.21/src/libcrun/container.c:3523:14: branch_false: following 'false' branch (when 'custom_handler' is non-NULL)...
crun-1.21/src/libcrun/container.c:3523:58: branch_false: ...to here
crun-1.21/src/libcrun/container.c:3528:23: call_function: calling 'xstrdup' from 'exec_process_entrypoint'
crun-1.21/src/libcrun/container.c:3528:23: return_function: returning to 'exec_process_entrypoint' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(*process_199(D)->args)' leaks here; was allocated at [(41)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/40)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def485]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(*status.bundle)'
crun-1.21/src/libcrun/criu.c:772:1: enter_function: entry to 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: call_function: calling 'load_wrapper' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:787:9: return_function: returning to 'libcrun_container_restore_linux_criu' from 'load_wrapper'
crun-1.21/src/libcrun/criu.c:788:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:791:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:791:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:794:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:795:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:798:24: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:798:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:801:7: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:801:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:804:14: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:805:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:808:18: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:818:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:821:11: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:822:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:831:12: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:832:8: branch_false: following 'false' branch...
crun-1.21/src/libcrun/criu.c:835:17: branch_false: ...to here
crun-1.21/src/libcrun/criu.c:917:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/criu.c:918:31: branch_true: ...to here
crun-1.21/src/libcrun/criu.c:918:22: call_function: calling 'xstrdup' from 'libcrun_container_restore_linux_criu'
crun-1.21/src/libcrun/criu.c:918:22: return_function: returning to 'libcrun_container_restore_linux_criu' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(*status.bundle)' leaks here; was allocated at [(34)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/33)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def486]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(a)'
crun-1.21/src/libcrun/intelrdt.c:233:1: enter_function: entry to 'resctl_create'
crun-1.21/src/libcrun/intelrdt.c:241:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:246:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:247:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:250:11: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:251:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_true: following 'true' branch (when 'l3_cache_schema' is non-NULL)...
crun-1.21/src/libcrun/intelrdt.c:254:26: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:7: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:259:27: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:259:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/intelrdt.c:269:12: call_function: calling 'validate_rdt_configuration' from 'resctl_create'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def487]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(b)'
crun-1.21/src/libcrun/intelrdt.c:233:1: enter_function: entry to 'resctl_create'
crun-1.21/src/libcrun/intelrdt.c:241:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:243:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:246:9: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:247:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:250:11: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:251:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:6: branch_true: following 'true' branch (when 'l3_cache_schema' is non-NULL)...
crun-1.21/src/libcrun/intelrdt.c:254:26: branch_true: ...to here
crun-1.21/src/libcrun/intelrdt.c:254:7: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:259:27: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:259:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_false: ...to here
crun-1.21/src/libcrun/intelrdt.c:268:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/intelrdt.c:269:12: call_function: calling 'validate_rdt_configuration' from 'resctl_create'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def488]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(cgroup_path + 14)'
crun-1.21/src/libcrun/cgroup-utils.c:1044:1: enter_function: entry to 'get_cgroup_dirfd_path'
crun-1.21/src/libcrun/cgroup-utils.c:1050:3: call_function: inlined call to 'get_proc_self_fd_path' from 'get_cgroup_dirfd_path'
crun-1.21/src/libcrun/cgroup-utils.c:1050:3: call_function: inlined call to 'get_proc_self_fd_path' from 'get_cgroup_dirfd_path'
crun-1.21/src/libcrun/cgroup-utils.c:1053:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1056:7: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1056:6: branch_true: following 'true' branch...
crun-1.21/src/libcrun/cgroup-utils.c:1058:24: branch_true: ...to here
crun-1.21/src/libcrun/cgroup-utils.c:1058:15: call_function: calling 'xstrdup' from 'get_cgroup_dirfd_path'
crun-1.21/src/libcrun/cgroup-utils.c:1058:15: return_function: returning to 'get_cgroup_dirfd_path' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(cgroup_path + 14)' leaks here; was allocated at [(19)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/18)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def489]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(from)'
crun-1.21/src/libcrun/cgroup-setup.c:493:1: enter_function: entry to 'enter_cgroup'
crun-1.21/src/libcrun/cgroup-setup.c:497:6: branch_true: following 'true' branch (when 'cgroup_mode == 1')...
crun-1.21/src/libcrun/cgroup-setup.c:499:13: branch_true: ...to here
crun-1.21/src/libcrun/cgroup-setup.c:499:13: call_function: calling 'enter_cgroup_v2' from 'enter_cgroup'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def490]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(name)'
crun-1.21/src/libcrun/cgroup-resources.c:1371:1: enter_function: entry to 'update_cgroup_resources'
crun-1.21/src/libcrun/cgroup-resources.c:1381:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1384:6: branch_false: following 'false' branch (when 'path' is non-NULL)...
crun-1.21/src/libcrun/cgroup-resources.c:1406:3: branch_false: ...to here
crun-1.21/src/libcrun/cgroup-resources.c:1409:14: call_function: calling 'update_cgroup_v2_resources' from 'update_cgroup_resources'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def491]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(own_cgroup)'
crun-1.21/src/libcrun/container.c:4272:1: enter_function: entry to 'restore_proxy_process'
crun-1.21/src/libcrun/container.c:4282:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4285:3: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4299:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/container.c:4302:21: branch_false: ...to here
crun-1.21/src/libcrun/container.c:4302:21: call_function: calling 'xstrdup' from 'restore_proxy_process'
crun-1.21/src/libcrun/container.c:4302:21: return_function: returning to 'restore_proxy_process' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(own_cgroup)' leaks here; was allocated at [(10)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/9)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def492]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(plugins)'
crun-1.21/src/libcrun/seccomp_notify.c:83:1: enter_function: entry to 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:87:73: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/seccomp_notify.c:92:6: branch_false: following 'false' branch...
crun-1.21/src/libcrun/seccomp_notify.c:95:24: branch_false: ...to here
crun-1.21/src/libcrun/seccomp_notify.c:95:15: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:95:15: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: call_function: calling 'xmalloc' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:96:16: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc'
crun-1.21/src/libcrun/seccomp_notify.c:102:18: call_function: calling 'xmalloc0' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:102:18: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xmalloc0'
crun-1.21/src/libcrun/seccomp_notify.c:104:7: call_function: calling 'xstrdup' from 'libcrun_load_seccomp_notify_plugins'
crun-1.21/src/libcrun/seccomp_notify.c:104:7: return_function: returning to 'libcrun_load_seccomp_notify_plugins' from 'xstrdup'
crun-1.21/src/libcrun/utils.h:225:6: danger: 'xstrdup(plugins)' leaks here; was allocated at [(28)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/27)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def493]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of 'xstrdup(state_root)'
crun-1.21/src/libcrun/status.c:617:1: enter_function: entry to 'libcrun_get_containers_list'
crun-1.21/src/libcrun/status.c:627:9: call_function: calling 'get_run_directory' from 'libcrun_get_containers_list'
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def494]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*<unknown>)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_true: following ‘true’ branch...
crun-1.21/src/exec.c:296:42: branch_true: ...to here
crun-1.21/src/exec.c:296:28: call_function: calling ‘xstrdup’ from ‘crun_command_exec’
crun-1.21/src/exec.c:296:28: return_function: returning to ‘crun_command_exec’ from ‘xstrdup’
crun-1.21/src/libcrun/utils.h:225:6: danger: ‘xstrdup(*<unknown>)’ leaks here; was allocated at [(24)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/23)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def495]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(exec_options.apparmor)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:297:7: branch_false: ...to here
crun-1.21/src/exec.c:298:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:300:27: branch_false: ...to here
crun-1.21/src/exec.c:303:23: call_function: calling ‘make_oci_process_user’ from ‘crun_command_exec’
crun-1.21/src/exec.c:303:23: return_function: returning to ‘crun_command_exec’ from ‘make_oci_process_user’
crun-1.21/src/exec.c:305:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:308:11: branch_false: ...to here
crun-1.21/src/exec.c:308:10: branch_true: following ‘true’ branch...
crun-1.21/src/exec.c:309:37: branch_true: ...to here
crun-1.21/src/exec.c:309:37: call_function: calling ‘xstrdup’ from ‘crun_command_exec’
crun-1.21/src/exec.c:309:37: return_function: returning to ‘crun_command_exec’ from ‘xstrdup’
crun-1.21/src/libcrun/utils.h:225:6: danger: ‘xstrdup(exec_options.apparmor)’ leaks here; was allocated at [(35)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/34)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def496]
crun-1.21/src/libcrun/utils.h:225:6: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(exec_options.process_label)’
crun-1.21/src/exec.c:253:1: enter_function: entry to ‘crun_command_exec’
crun-1.21/src/exec.c:272:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:275:25: branch_false: ...to here
crun-1.21/src/exec.c:280:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:286:7: branch_false: ...to here
crun-1.21/src/exec.c:286:6: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:290:17: branch_false: ...to here
crun-1.21/src/exec.c:290:17: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:290:17: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:294:23: call_function: calling ‘xmalloc0’ from ‘crun_command_exec’
crun-1.21/src/exec.c:294:23: return_function: returning to ‘crun_command_exec’ from ‘xmalloc0’
crun-1.21/src/exec.c:295:19: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:297:7: branch_false: ...to here
crun-1.21/src/exec.c:298:10: branch_false: following ‘false’ branch...
crun-1.21/src/exec.c:300:27: branch_false: ...to here
crun-1.21/src/exec.c:303:23: call_function: calling ‘make_oci_process_user’ from ‘crun_command_exec’
crun-1.21/src/exec.c:303:23: return_function: returning to ‘crun_command_exec’ from ‘make_oci_process_user’
crun-1.21/src/exec.c:305:10: branch_true: following ‘true’ branch...
crun-1.21/src/exec.c:306:34: branch_true: ...to here
crun-1.21/src/exec.c:306:34: call_function: calling ‘xstrdup’ from ‘crun_command_exec’
crun-1.21/src/exec.c:306:34: return_function: returning to ‘crun_command_exec’ from ‘xstrdup’
crun-1.21/src/libcrun/utils.h:225:6: danger: ‘xstrdup(exec_options.process_label)’ leaks here; was allocated at [(33)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/32)
#  223|   
#  224|     ret = strdup (str);
#  225|->   if (ret == NULL)
#  226|       OOM ();
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def497]
crun-1.21/src/spec.c:126:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(where, "w+e")’
crun-1.21/src/spec.c:99:6: branch_false: following ‘false’ branch...
crun-1.21/src/spec.c:103:7: branch_false: ...to here
crun-1.21/src/spec.c:103:6: branch_false: following ‘false’ branch...
crun-1.21/src/spec.c:117:17: branch_false: ...to here
crun-1.21/src/spec.c:126:7: acquire_resource: opened here
crun-1.21/src/spec.c:126:7: danger: ‘fopen(where, "w+e")’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  124|       }
#  125|   
#  126|->   f = fopen (where, "w+e");
#  127|     if (f == NULL)
#  128|       return libcrun_make_error (err, errno, "cannot open `%s`", where);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def498]
crun-1.21/src/spec.c:126:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(where, "w+e")’
crun-1.21/src/spec.c:99:6: branch_false: following ‘false’ branch...
crun-1.21/src/spec.c:103:7: branch_false: ...to here
crun-1.21/src/spec.c:103:6: branch_false: following ‘false’ branch...
crun-1.21/src/spec.c:117:17: branch_false: ...to here
crun-1.21/src/spec.c:126:7: acquire_memory: allocated here
crun-1.21/src/spec.c:126:7: danger: ‘fopen(where, "w+e")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  124|       }
#  125|   
#  126|->   f = fopen (where, "w+e");
#  127|     if (f == NULL)
#  128|       return libcrun_make_error (err, errno, "cannot open `%s`", where);

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-199.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecrun-1.21-1.fc43
store-results-to/tmp/tmpm9xjdw6e/crun-1.21-1.fc43.tar.xz
time-created2025-04-25 12:18:09
time-finished2025-04-25 12:20:55
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpm9xjdw6e/crun-1.21-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpm9xjdw6e/crun-1.21-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9