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

Re: [libvirt] [PATCH] Fix memory leak in virNetSocketNewConnectUNIX



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


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