Task #56495 - added.err

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:37:23: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
#   35|           if (ret->values == NULL)
#   36|             return NULL;
#   37|->         for (i = 0; i < len; i++)
#   38|             {
#   39|               yajl_val val;

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

Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3481: error[memleak]: Memory leak: ret
# 3479|                 {
# 3480|                   yajl_tree_free (resi);
# 3481|->                 return NULL;
# 3482|                 }
# 3483|             }

Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3581: error[memleak]: Memory leak: ret
# 3579|           ret->boottime = clone_runtime_spec_schema_defs_linux_time_offsets (src->boottime);
# 3580|           if (ret->boottime == NULL)
# 3581|->           return NULL;
# 3582|         }
# 3583|       if (src->monotonic)

Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:3587: error[memleak]: Memory leak: ret
# 3585|           ret->monotonic = clone_runtime_spec_schema_defs_linux_time_offsets (src->monotonic);
# 3586|           if (ret->monotonic == NULL)
# 3587|->           return NULL;
# 3588|         }
# 3589|       return move_ptr (ret);

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/json_common.h:9: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:8: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c: scope_hint: In function 'make_runtime_spec_schema_config_linux'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:154:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_linux_net_devices(get_val(tree, "netDevices", 3), ctx,  err)'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:177:29: note: in expansion of macro 'YAJL_IS_OBJECT'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_linux.c:24:9: note: in expansion of macro 'YAJL_GET_OBJECT'
#  152|   #define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_INT_VALID))
#  153|   #define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.number.flags & YAJL_NUMBER_DOUBLE_VALID))
#  154|-> #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|   #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/net_device.c:23: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'move_network_device'
crun-HEAD/src/libcrun/utils.h:65:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(8192)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'xrealloc'
crun-HEAD/src/libcrun/utils.h:83:21: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'get_ip_addresses'
crun-HEAD/src/libcrun/utils.h:83:21: warning[-Wanalyzer-malloc-leak]: leak of 'xrealloc(ips, (ips_len + 2) * 24)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:24: included_from: Included from here.
crun-HEAD/src/libcrun/net_device.c:30: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   81|   {
#   82|     void *res = realloc (ptr, size);
#   83|->   if (UNLIKELY (res == NULL))
#   84|       OOM ();
#   85|     return res;

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