Task #87481 - added.err

back to task #87481
download
Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c: scope_hint: In function 'clone_runtime_spec_schema_config_freebsd_jail'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:445:28: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_freebsd_jail_allow(*src.allow)'
#  443|       if (ret == NULL)
#  444|         return NULL;
#  445|->     ret->set_hostname = src->set_hostname;
#  446|       ret->set_hostname_present = src->set_hostname_present;
#  447|       ret->raw_sockets = src->raw_sockets;

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:476:24: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  474|       ret->reserved_ports_present = src->reserved_ports_present;
#  475|       ret->suser = src->suser;
#  476|->     ret->suser_present = src->suser_present;
#  477|       return move_ptr (ret);
#  478|   }

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c: scope_hint: In function 'clone_runtime_spec_schema_config_freebsd'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1077:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_freebsd_jail(*src.jail)'
# 1075|       if (ret == NULL)
# 1076|         return NULL;
# 1077|->     if (src->parent)
# 1078|         {
# 1079|           ret->parent = strdup (src->parent);

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

Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1087: error[memleak]: Memory leak: ret
# 1085|           ret->host = strdup (src->host);
# 1086|           if (ret->host == NULL)
# 1087|->           return NULL;
# 1088|         }
# 1089|       if (src->ip4)

Error: CPPCHECK_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1093: error[memleak]: Memory leak: ret
# 1091|           ret->ip4 = strdup (src->ip4);
# 1092|           if (ret->ip4 == NULL)
# 1093|->           return NULL;
# 1094|         }
# 1095|       if (src->ip4addr)

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:1181:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1179|       ret->enforce_statfs = src->enforce_statfs;
# 1180|       ret->enforce_statfs_present = src->enforce_statfs_present;
# 1181|->     if (src->allow)
# 1182|         {
# 1183|           ret->allow = clone_runtime_spec_schema_config_freebsd_jail_allow (src->allow);

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1075:12: warning[-Wanalyzer-malloc-leak]: leak of 'clone_runtime_spec_schema_config_vm_hw_config(*src.hw_config)'
# 1073|       if (ret == NULL)
# 1074|         return NULL;
# 1075|->     if (src->device_tree)
# 1076|         {
# 1077|           ret->device_tree = strdup (src->device_tree);

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_vm.c:1114:8: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
# 1112|             }
# 1113|         }
# 1114|->     if (src->irqs)
# 1115|         {
# 1116|           ret->irqs_len = src->irqs_len;

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-401):
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_vm.c: scope_hint: In function 'make_runtime_spec_schema_defs_vm_io_mem_entry_format'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_defs_vm.c:139:12: warning[-Wanalyzer-malloc-leak]: leak of 'resi'
#  137|             (void) fprintf (ctx->errfile, "WARNING: unknown key found\n");
#  138|   
#  139|->         if (ctx->options & OPT_PARSE_FULLKEY)
#  140|             ret->_residual = resi;
#  141|         }

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_freebsd.h:7: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:8: included_from: Included from here.
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c: scope_hint: In function 'make_runtime_spec_schema_config_freebsd_jail'
crun-HEAD/libocispec/yajl/src/api/yajl_tree.h:156:49: warning[-Wanalyzer-malloc-leak]: leak of 'make_runtime_spec_schema_config_freebsd_jail_allow(get_val(tree, "allow", 3), ctx,  err)'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:29:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:29:33: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:48:32: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:67:28: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:112:27: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:131:30: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:150:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:169:35: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:188:26: note: in expansion of macro 'YAJL_IS_TRUE'
crun-HEAD/libocispec/src/ocispec/runtime_spec_schema_config_freebsd.c:29:33: note: in expansion of macro 'YAJL_IS_TRUE'
#  154|   #define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))
#  155|   #define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))
#  156|-> #define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))
#  157|   #define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))
#  158|   #define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))

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