[PATCH 1/2] virSysinfoParseX86Chassis: Store asset tag into correct pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Probably due to copy-paste error we're storing asset tag into
def->sku which we even use in the next step to store SKU number
and thus the asset tag leaks.

==19200== 41 bytes in 1 blocks are definitely lost in loss record 849 of 1,059
==19200==    at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
==19200==    by 0x8785419: strndup (in /lib64/libc-2.25.so)
==19200==    by 0x53588D7: virStrndup (virstring.c:1023)
==19200==    by 0x535C6CF: virSysinfoParseX86Chassis (virsysinfo.c:882)
==19200==    by 0x535DA67: virSysinfoReadX86 (virsysinfo.c:1149)
==19200==    by 0x535DB3A: virSysinfoRead (virsysinfo.c:1206)
==19200==    by 0x2BE0B27E: qemuStateInitialize (qemu_driver.c:641)
==19200==    by 0x556AB4F: virStateInitialize (libvirt.c:770)
==19200==    by 0x1299B9: daemonRunStateInit (remote_daemon.c:846)
==19200==    by 0x5361A58: virThreadHelper (virthread.c:206)
==19200==    by 0x84E3896: start_thread (in /lib64/libpthread-2.25.so)
==19200==    by 0x87F4CFE: clone (in /lib64/libc-2.25.so)

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virsysinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 137f14ae4..43a4c8835 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -879,7 +879,7 @@ virSysinfoParseX86Chassis(const char *base,
     if ((cur = strstr(base, "Asset Tag: ")) != NULL) {
         cur += 11;
         eol = strchr(cur, '\n');
-        if (eol && VIR_STRNDUP(def->sku, cur, eol - cur) < 0)
+        if (eol && VIR_STRNDUP(def->asset, cur, eol - cur) < 0)
             goto cleanup;
     }
     if ((cur = strstr(base, "SKU Number: ")) != NULL) {
-- 
2.16.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux