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 <mpriv...@redhat.com>
---
 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to