Description of problem: As subject Version-Release number of selected component (if applicable): libvirt-7.0.0-10.module+el8.4.0+10417+37f6984d.x86_64 How reproducible: 100% Steps to Reproduce: # valgrind --leak-check=full virsh setmem 100 Actual results: ==236992== 28 (24 direct, 4 indirect) bytes in 1 blocks are definitely lost in loss record 98 of 272 ==236992== at 0x4C3721A: calloc (vg_replace_malloc.c:760) ==236992== by 0x5C6E2FD: g_malloc0 (gmem.c:129) ==236992== by 0x17F40D: vshCommandParse (vsh.c:1471) ==236992== by 0x17FF61: vshCommandArgvParse (vsh.c:1597) ==236992== by 0x13AC63: virshParseArgv (virsh.c:782) ==236992== by 0x13AC63: main (virsh.c:886) Expected results: No direct or indirect bytes of definitely lost Additional info:
Proposed upstream patch: https://listman.redhat.com/archives/libvir-list/2021-April/msg00167.html
Tested the patch with libvirt upstream version v7.2.0-84-gafda589d05. No definitely lost any more. valgrind --leak-check=full virsh set mem 100 ==86243== LEAK SUMMARY: ==86243== definitely lost: 0 bytes in 0 blocks ==86243== indirectly lost: 0 bytes in 0 blocks ==86243== possibly lost: 1,352 bytes in 18 blocks ==86243== still reachable: 129,787 bytes in 926 blocks ==86243== of which reachable via heuristic: ==86243== newarray : 1,536 bytes in 16 blocks ==86243== suppressed: 0 bytes in 0 blocks ==86243== Reachable blocks (those to which a pointer was found) are not shown. ==86243== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==86243== ==86243== For lists of detected and suppressed errors, rerun with: -s ==86243== ERROR SUMMARY: 18 errors from 18 contexts (suppressed: 0 from 0)
Pushed as: commit a131b8b517a88685ddb5f1b17c4d1a16b9a97b61 Author: Ján Tomko <jtomko> CommitDate: 2021-04-09 13:07:30 +0200 vsh: fix memory leak in vshCommandParse One of the error branches used a plain free where vshCommandFree was required. https://bugzilla.redhat.com/show_bug.cgi?id=1943415 Signed-off-by: Ján Tomko <jtomko> Reviewed-by: Erik Skultety <eskultet> git describe: v7.2.0-85-ga131b8b517
Verified with libvirt-daemon-7.3.0-1.module+el8.5.0+11004+f4810536.x86_64 & qemu-kvm-6.0.0-16.module+el8.5.0+10848+2dccc46d.x86_64 Steps as comment2.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4684