mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
virsh: Fix memory leak in cmdNetworkDHCPLeases
After cidr_format is allocated by virAsprintf and used by vshPrintExtra it needs to be freed. Fix the following memory leak from valgrind: 18 bytes in 1 blocks are definitely lost in loss record 41 of 192 at 0x4C29BBD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x85CE36F: __vasprintf_chk (vasprintf_chk.c:80) by 0x4EE52D5: UnknownInlinedFun (stdio2.h:210) by 0x4EE52D5: virVasprintfInternal (virstring.c:459) by 0x4EE53CA: virAsprintfInternal (virstring.c:480) by 0x14FE96: cmdNetworkDHCPLeases (virsh-network.c:1378) by 0x13006B: vshCommandRun (virsh.c:1915) by 0x12A9E1: main (virsh.c:3699) Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
parent
44178b8e80
commit
089663aefa
@ -1381,6 +1381,8 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd)
|
||||
expirytime, EMPTYSTR(lease->mac),
|
||||
EMPTYSTR(typestr), cidr_format,
|
||||
EMPTYSTR(lease->hostname), EMPTYSTR(lease->clientid));
|
||||
|
||||
VIR_FREE(cidr_format);
|
||||
}
|
||||
|
||||
ret = true;
|
||||
|
Loading…
Reference in New Issue
Block a user