Re: [PATCH] node_device: Don't leak error message buffer from virMdevctlListDefined|Active

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

 



On 7/19/23 3:41 PM, Peter Krempa wrote:
nodeDeviceUpdateMediatedDevices invokes virMdevctlListDefined and
virMdevctlListActive both of which were passed the same 'errmsg' buffer.

Since virCommandSetErrorBuffer() always allocates the error buffer one
of them was leaked.

Fix it by populating the 'errmsg' buffer only on failure of
virMdevctlListActive|Defined which invoke the command.

Add a comment to nodeDeviceGetMdevctlListCommand reminding how
virCommandSetErrorBuffer() works.

Fixes: 44a0f2f0c8f
Signed-off-by: Peter Krempa<pkrempa@xxxxxxxxxx>

LGTM Thanks for catching and fixing it.

Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>

--
Mit freundlichen Grüßen/Kind regards
   Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294





[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