[libvirt] [PATCH] Fix memory leak in virNWFilterDefParseXML()
Daniel P. Berrange
berrange at redhat.com
Fri Nov 29 15:24:28 UTC 2013
On Fri, Nov 29, 2013 at 08:40:31PM +0530, Nehal J Wani wrote:
> >
> > I think it is preferrable to use virNWFilterEntryFree() here.
> >
> >> if (entry->rule || entry->include) {
> >
> > Just following this line there is another call to VIR_FREE(entry)
> > which leaks entry->rule and entry->include. This should be made
> > to call virNWFilterEntryFree too
> >
> >
>
> Would it be better to remove all the VIR_FREE(entry) and just put one
> virNWFilterEntryFree(entry) below the label cleanup ?
Yes, just make sure it is always initialized sanely.
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 :|
More information about the libvir-list
mailing list