Re: [PATCH] Fix memory leak in virNetSocketNewConnectUNIX

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

 



On Fri, Apr 24, 2015 at 13:34:25 +0200, Michal Privoznik wrote:
> On 24.04.2015 12:03, Jiri Denemark wrote:
...
> > - error:
> > + cleanup:
> >      if (lockfd != -1) {
> >          unlink(lockpath);
> >          VIR_FORCE_CLOSE(lockfd);
> >      }
> >      VIR_FREE(lockpath);
> >      VIR_FREE(rundir);
> > -    VIR_FORCE_CLOSE(fd);
> > -    return -1;
> > +
> > +    if (ret == -1)
> 
> s/== -1/< 0/ please. It is more future proof IMO. For instance, if we
> invent new return value to describe more specifically what went wrong,
> and we still want the socket to close.

Done, will push soon. Thanks,

Jirka

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