Task #229 - fixed.err

back to task #229
download
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-10.1.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-10.1.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected
libvirt-10.1.0/tests/commandhelper.c: scope_hint: In function ‘main’
/usr/include/stdio.h: scope_hint: In function ‘main’
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-10.1.0/tests/commandhelper.c: scope_hint: In function ‘main’
libvirt-10.1.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-10.1.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-401):
libvirt-10.1.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-10.1.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-10.1.0/tests/securityselinuxlabeltest.c: scope_hint: In function ‘testSELinuxLoadFileList’
libvirt-10.1.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.1.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-401):
libvirt-10.1.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.1.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-10.1.0/tests/virhostcputest.c: scope_hint: In function ‘hostCPUSignature’
libvirt-10.1.0/tests/virhostcputest.c:193:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-10.1.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Error: GCC_ANALYZER_WARNING (CWE-401):
libvirt-10.1.0/tests/virhostcputest.c:193:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-10.1.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Error: CLANG_WARNING:
libvirt-10.1.0/tools/vsh.c:661:25: warning[deadcode.DeadStores]: Value stored to 'fmt' during its initialization is never read
#  659|           const vshCmdOptDef *opt;
#  660|           for (opt = def->opts; opt->name; opt++) {
#  661|->             const char *fmt = "%s";
#  662|               switch (opt->type) {
#  663|               case VSH_OT_BOOL: