Newly introduced defects

List of Defects

Error: CPPCHECK_WARNING (CWE-401): [#def1]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1256: error[memleak]: Memory leak: ret
# 1254|       ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1255|       if (ret->idmap == NULL && *err != 0)
# 1256|->       return NULL;
# 1257|   
# 1258|       if (tree->type == yajl_t_object)

Error: CLANG_WARNING: [#def2]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1256:14: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1254|       ret->idmap = make_runtime_spec_schema_features_linux_mount_extensions_idmap (get_val (tree, "idmap", yajl_t_object), ctx, err);
# 1255|       if (ret->idmap == NULL && *err != 0)
# 1256|->       return NULL;
# 1257|   
# 1258|       if (tree->type == yajl_t_object)

Error: CPPCHECK_WARNING (CWE-401): [#def3]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1269: error[memleak]: Memory leak: ret
# 1267|               resi = calloc (1, sizeof(*tree));
# 1268|               if (resi == NULL)
# 1269|->               return NULL;
# 1270|   
# 1271|               resi->type = yajl_t_object;

Error: CPPCHECK_WARNING (CWE-401): [#def4]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1276: error[memleak]: Memory leak: ret
# 1274|                 {
# 1275|                   yajl_tree_free (resi);
# 1276|->                 return NULL;
# 1277|                 }
# 1278|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CLANG_WARNING: [#def5]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1276:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1274|                 {
# 1275|                   yajl_tree_free (resi);
# 1276|->                 return NULL;
# 1277|                 }
# 1278|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: CPPCHECK_WARNING (CWE-401): [#def6]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1282: error[memleak]: Memory leak: ret
# 1280|                 {
# 1281|                   yajl_tree_free (resi);
# 1282|->                 return NULL;
# 1283|                 }
# 1284|             }

Error: CLANG_WARNING: [#def7]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1378:22: warning[unix.Malloc]: Potential leak of memory pointed to by 'ret'
# 1376|               ret->namespaces = calloc (len + 1, sizeof (*ret->namespaces));
# 1377|               if (ret->namespaces == NULL)
# 1378|->               return NULL;
# 1379|               for (i = 0; i < len; i++)
# 1380|                 {

Error: CLANG_WARNING: [#def8]
crun-1.15-build/crun-1.15/libocispec/src/ocispec/runtime_spec_schema_features_linux.c:1456:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'resi'
# 1454|                 {
# 1455|                   yajl_tree_free (resi);
# 1456|->                 return NULL;
# 1457|                 }
# 1458|               resi->u.object.values = calloc (cnt, sizeof (yajl_val));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
crun-1.15-build/crun-1.15/src/libcrun/container.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function 'libcrun_container_get_features'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc0(144)'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro 'UNLIKELY'
#   69|   {
#   70|     void *res = calloc (1, size);
#   71|->   if (UNLIKELY (res == NULL))
#   72|       OOM ();
#   73|     return res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
crun-1.15-build/crun-1.15/src/libcrun/container.c:24: included_from: Included from here.
crun-1.15-build/crun-1.15/src/libcrun/utils.h: scope_hint: In function ‘libcrun_container_get_features’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc0(144)’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
crun-1.15-build/crun-1.15/src/libcrun/utils.h:56:40: note: in definition of macro ‘UNLIKELY’
#   69|   {
#   70|     void *res = calloc (1, size);
#   71|->   if (UNLIKELY (res == NULL))
#   72|       OOM ();
#   73|     return res;

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-235.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namecrun-1.14.4-1.fc40
diffbase-store-results-to/tmp/tmpihc5ui3j/crun-1.14.4-1.fc40.tar.xz
diffbase-time-created2024-07-03 12:11:30
diffbase-time-finished2024-07-03 12:16:47
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpihc5ui3j/crun-1.14.4-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpihc5ui3j/crun-1.14.4-1.fc40.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-235.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namecrun-1.15-1.fc41
store-results-to/tmp/tmpdouv5jsl/crun-1.15-1.fc41.tar.xz
time-created2024-07-03 12:17:18
time-finished2024-07-03 12:22:11
titleNewly introduced defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpdouv5jsl/crun-1.15-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpdouv5jsl/crun-1.15-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9