Re: [PATCH 3/3] Coverity: Resolve a RESOURCE_LEAK

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

 



On Tue, Mar 25, 2014 at 03:00:02PM -0600, Eric Blake wrote:
> On 03/25/2014 12:00 PM, John Ferlan wrote:
> > On error the lofd would have been leaked.
> > 
> > Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> > ---
> >  src/lxc/lxc_controller.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> > 
> 
> > +
> > + cleanup:
> >      VIR_FREE(loname);
> > +    if (ret == -1)
> 
> I might have written 'if (ret < 0)' as that is slightly faster on many
> machines, but what you have works.

As a coding style point we use 'ret < 0' in the vast majority of places,
so we should prefer that over 'ret == -1'


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