Task #229 - added.err
back to task #229download
Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzReadConfigParam’ libvirt-10.2.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’ # 618| char *sf, *token, *saveptr = NULL; # 619| # 620|-> fp = fopen(conf_file, "r"); # 621| if (fp == NULL) # 622| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’ # 618| char *sf, *token, *saveptr = NULL; # 619| # 620|-> fp = fopen(conf_file, "r"); # 621| if (fp == NULL) # 622| return -1; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvz_copyfile’ libvirt-10.2.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(from_path, "r")’ # 680| int bytes_read; # 681| # 682|-> fp = fopen(from_path, "r"); # 683| if (fp == NULL) # 684| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(from_path, "r")’ # 680| int bytes_read; # 681| # 682|-> fp = fopen(from_path, "r"); # 683| if (fp == NULL) # 684| return -1; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzGetVPSUUID’ libvirt-10.2.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’ # 820| return -1; # 821| # 822|-> fp = fopen(conf_file, "r"); # 823| if (fp == NULL) # 824| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’ # 820| return -1; # 821| # 822|-> fp = fopen(conf_file, "r"); # 823| if (fp == NULL) # 824| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzSetDefinedUUID’ libvirt-10.2.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "a")’ # 874| # 875| if (uuidstr[0] == 0) { # 876|-> fp = fopen(conf_file, "a"); /* append */ # 877| if (fp == NULL) # 878| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "a")’ # 874| # 875| if (uuidstr[0] == 0) { # 876|-> fp = fopen(conf_file, "a"); /* append */ # 877| if (fp == NULL) # 878| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/openvz/openvz_driver.c: scope_hint: In function ‘openvzGetProcessInfo’ libvirt-10.2.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/vz/vestat", "r")’ # 1416| */ # 1417| # 1418|-> if ((fp = fopen("/proc/vz/vestat", "r")) == NULL) # 1419| return -1; # 1420| Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/vz/vestat", "r")’ # 1416| */ # 1417| # 1418|-> if ((fp = fopen("/proc/vz/vestat", "r")) == NULL) # 1419| return -1; # 1420| Error: GCC_ANALYZER_WARNING (CWE-688): libvirt-10.2.0/src/qemu/qemu_capabilities.c: scope_hint: In function ‘virQEMUCapsNewForBinaryInternal’ libvirt-10.2.0/src/qemu/qemu_capabilities.c:5703:9: warning[-Wanalyzer-null-argument]: use of NULL ‘binary’ where non-null expected /usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here. /usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here. /usr/include/glib-2.0/glib.h:56: included_from: Included from here. libvirt-10.2.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.2.0/src/internal.h:30: included_from: Included from here. libvirt-10.2.0/src/util/virobject.h:24: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_capabilities.h:24: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_capabilities.c:24: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_capabilities.c:1830:24: note: in expansion of macro ‘g_strdup’ libvirt-10.2.0/src/qemu/qemu_capabilities.c: scope_hint: In function ‘virQEMUCapsNewForBinaryInternal’ /usr/include/features.h:511: included_from: Included from here. /usr/include/errno.h:25: included_from: Included from here. libvirt-10.2.0/src/internal.h:23: included_from: Included from here. /usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null # 5701| /* We would also want to check faccessat if we cared about ACLs, # 5702| * but we don't. */ # 5703|-> if (stat(binary, &sb) < 0) { # 5704| virReportSystemError(errno, _("Cannot check QEMU binary %1$s"), # 5705| binary); Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_domain.c: scope_hint: In function ‘qemuDomainSecretStorageSourcePrepareEncryption’ libvirt-10.2.0/src/qemu/qemu_domain.c:1430:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.2.0/src/qemu/qemu_domain.c:24: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_domain.c:859:12: note: in expansion of macro ‘QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE’ # 1428| srcPriv = qemuDomainStorageSourcePrivateFetch(src); # 1429| # 1430|-> srcPriv->enccount = nsecrets; # 1431| srcPriv->encinfo = g_new0(qemuDomainSecretInfo *, nsecrets); # 1432| for (i = 0; i < nsecrets; ++i) { Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_domain.c: scope_hint: In function ‘qemuProcessPrepareStorageSourceTLSVxhs’ libvirt-10.2.0/src/qemu/qemu_domain.c:10371:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.2.0/src/qemu/qemu_domain.c:859:12: note: in expansion of macro ‘QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE’ #10369| qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src); #10370| #10371|-> if (!(srcpriv->tlsKeySecret = qemuDomainSecretInfoTLSNew(priv, src->tlsAlias, #10372| cfg->vxhsTLSx509secretUUID))) #10373| return -1; Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_domain.c: scope_hint: In function ‘qemuProcessPrepareStorageSourceTLSNBD’ libvirt-10.2.0/src/qemu/qemu_domain.c:10408:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.2.0/src/qemu/qemu_domain.c:859:12: note: in expansion of macro ‘QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE’ #10406| qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src); #10407| #10408|-> if (!(srcpriv->tlsKeySecret = qemuDomainSecretInfoTLSNew(priv, src->tlsAlias, #10409| cfg->nbdTLSx509secretUUID))) #10410| return -1; Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_domain.c: scope_hint: In function ‘qemuDomainPrepareStorageSourceFDs’ libvirt-10.2.0/src/qemu/qemu_domain.c:11247:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.2.0/src/qemu/qemu_domain.c:859:12: note: in expansion of macro ‘QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE’ #11245| srcpriv = qemuDomainStorageSourcePrivateFetch(src); #11246| #11247|-> srcpriv->fdpass = qemuFDPassNew(qemuBlockStorageSourceGetStorageNodename(src), priv); #11248| #11249| for (i = 0; i < fdt->nfds; i++) { Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_domain.c: scope_hint: In function ‘qemuDomainPrepareHostdevSCSI’ libvirt-10.2.0/src/qemu/qemu_domain.c:11460:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libvirt-10.2.0/src/qemu/qemu_domain.c:859:12: note: in expansion of macro ‘QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE’ #11458| qemuDomainStorageSourcePrivate *srcPriv = qemuDomainStorageSourcePrivateFetch(src); #11459| #11460|-> if (!(srcPriv->secinfo = qemuDomainSecretInfoSetupFromSecret(priv, #11461| backendalias, #11462| NULL, 0, Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_driver.c: scope_hint: In function ‘qemuDomainPinVcpuFlags’ libvirt-10.2.0/src/qemu/qemu_driver.c:4413:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’ libvirt-10.2.0/src/qemu/qemu_agent.h:24: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_driver.c:34: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_driver.c:4374:5: note: in expansion of macro ‘virCheckFlags’ # 4411| # 4412| if (persistentDef) { # 4413|-> virBitmapFree(vcpuinfo->cpumask); # 4414| vcpuinfo->cpumask = g_steal_pointer(&pcpumap); # 4415| Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_driver.c:57: included_from: Included from here. libvirt-10.2.0/src/qemu/qemu_driver.c: scope_hint: In function ‘qemuDomainDefineXMLFlags’ libvirt-10.2.0/src/qemu/qemu_driver.c:6452:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vm’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6452:13: note: in expansion of macro ‘VIR_INFO’ libvirt-10.2.0/src/qemu/qemu_driver.c:6409:5: note: in expansion of macro ‘virCheckFlags’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6452:13: note: in expansion of macro ‘VIR_INFO’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6452:13: note: in expansion of macro ‘VIR_INFO’ # 6450| /* There is backup so this VM was defined before. # 6451| * Just restore the backup. */ # 6452|-> VIR_INFO("Restoring domain '%s' definition", vm->def->name); # 6453| if (virDomainObjIsActive(vm)) # 6454| vm->newDef = oldDef; Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_driver.c:6460:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vm’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6460:13: note: in expansion of macro ‘VIR_INFO’ libvirt-10.2.0/src/qemu/qemu_driver.c:6409:5: note: in expansion of macro ‘virCheckFlags’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6460:13: note: in expansion of macro ‘VIR_INFO’ libvirt-10.2.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’ libvirt-10.2.0/src/qemu/qemu_driver.c:6460:13: note: in expansion of macro ‘VIR_INFO’ # 6458| } else { # 6459| /* Brand new domain. Remove it */ # 6460|-> VIR_INFO("Deleting domain '%s'", vm->def->name); # 6461| qemuDomainRemoveInactive(driver, vm, 0, false); # 6462| } Error: GCC_ANALYZER_WARNING (CWE-476): libvirt-10.2.0/src/qemu/qemu_driver.c: scope_hint: In function ‘qemuDomainUpdateDeviceConfig’ libvirt-10.2.0/src/qemu/qemu_driver.c:7093:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’ libvirt-10.2.0/src/qemu/qemu_driver.c:7398:5: note: in expansion of macro ‘virCheckFlags’ # 7091| virDomainNetDef *net; # 7092| virDomainMemoryDef *mem; # 7093|-> virDomainDeviceDef oldDev = { .type = dev->type }; # 7094| int pos; # 7095| Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’ libvirt-10.2.0/src/util/vircgroup.c:353:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(procfile, "r")’ /usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here. /usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here. /usr/include/glib-2.0/glib.h:56: included_from: Included from here. libvirt-10.2.0/src/util/glibcompat.h:21: included_from: Included from here. libvirt-10.2.0/src/internal.h:30: included_from: Included from here. libvirt-10.2.0/src/util/virbitmap.h:24: included_from: Included from here. libvirt-10.2.0/src/util/vircgroup.h:24: included_from: Included from here. libvirt-10.2.0/src/util/vircgrouppriv.h:28: included_from: Included from here. libvirt-10.2.0/src/util/vircgroup.c:36: included_from: Included from here. libvirt-10.2.0/src/util/vircgroup.c:348:20: note: in expansion of macro ‘g_strdup’ libvirt-10.2.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’ # 351| } # 352| # 353|-> mapping = fopen(procfile, "r"); # 354| if (mapping == NULL) { # 355| virReportSystemError(errno, Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/util/vircgroup.c:353:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(procfile, "r")’ libvirt-10.2.0/src/util/vircgroup.c:348:20: note: in expansion of macro ‘g_strdup’ libvirt-10.2.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’ # 351| } # 352| # 353|-> mapping = fopen(procfile, "r"); # 354| if (mapping == NULL) { # 355| virReportSystemError(errno, Error: GCC_ANALYZER_WARNING (CWE-775): libvirt-10.2.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupKillInternal’ libvirt-10.2.0/src/util/vircgroup.c:2672:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(keypath, "r")’ libvirt-10.2.0/src/util/vircgrouppriv.h:29: included_from: Included from here. libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ # 2670| while (!done) { # 2671| done = true; # 2672|-> if (!(fp = fopen(keypath, "r"))) { # 2673| if (errno == ENOENT) { # 2674| VIR_DEBUG("No file %s, assuming done", keypath); Error: GCC_ANALYZER_WARNING (CWE-401): libvirt-10.2.0/src/util/vircgroup.c:2672:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(keypath, "r")’ libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ libvirt-10.2.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’ # 2670| while (!done) { # 2671| done = true; # 2672|-> if (!(fp = fopen(keypath, "r"))) { # 2673| if (errno == ENOENT) { # 2674| VIR_DEBUG("No file %s, assuming done", keypath); Error: GCC_ANALYZER_WARNING (CWE-688): libvirt-10.2.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-10.2.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected libvirt-10.2.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.2.0/tests/commandhelper.c: scope_hint: In function ‘main’ libvirt-10.2.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-10.2.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.2.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-10.2.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.2.0/tests/securityselinuxlabeltest.c: scope_hint: In function ‘testSELinuxLoadFileList’ libvirt-10.2.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.2.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.2.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.2.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.2.0/tests/virhostcputest.c: scope_hint: In function ‘hostCPUSignature’ libvirt-10.2.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.2.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.2.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.2.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.2.0/tools/vsh.c:1583:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'clast' # 1581| } # 1582| # 1583|-> return true; # 1584| # 1585| syntaxError: