Re: [PATCH v2 4/6] Fix possible memory leak in virsh-domain-monitor.c in cmdDomblklist

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

 




On 01/16/2014 08:33 AM, Pavel Hrdina wrote:
> In a "for" loop there are created two new strings and they may not
> be freed if a "target" string cannot be obtained. We have to free
> the two created strings to prevent the memory leak.
> 
> This has been found by coverity.
> 
> John also pointed out that we should somehow care about the "type"
> and "device" and Osier agreed to exit with error message if one of
> them is set to NULL.
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
> version 2:
>  - initialize "type" and "device" to NULL
>  - exit with error message if "type" and "device" is NULL
>  - remove a "if (details)" condition before freeing "type" and "device"
> 
>  tools/virsh-domain-monitor.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 

ACK

John

--
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]