Re: [PATCH] Memory Leak Fix: Check def->info->alias before assigning

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

 



On Wed, Nov 27, 2013 at 04:01:45AM +0530, Nehal J Wani wrote:
> On running the command make -C tests valgrind, there used to be a bunch of
> memory leaks shown by valgrind. Specifically, one can check it by running:
> libtool --mode=execute valgrind --quiet --leak-check=full --suppressions=./.valgrind.supp qemuhotplugtest
> The issue was that def->info->alias was already malloc'ed by xmlStrndup in
> virDomainDeviceInfoParseXML (domain_conf.c:3439). The new alias was being
> assigned again without freeing the old one in qemuAssignDeviceAliases().
> This patch checks if the entity exists, and frees accordingly, hence making
> valgrind cry lesser.

The 'alias' attribute should *not* be parsed from the XML provided by
the user. It should only be parsed in the live state XML. In the latter
case no codepath should take us to qemuAssignDeviceAliases. So this is
certainly not the right fix. It sounds like the test case is flawed to
me.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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