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

Re: [libvirt] PATCH: 4/25: Cleanup exit paths in remote driver



On Wed, Jan 14, 2009 at 08:39:02PM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange redhat com> wrote:
> > This patch ensures all public API methods only have a single exit
> > path, to make mutex unlocking simpler.
> >
> >  remote_internal.c | 1256 +++++++++++++++++++++++++++++++++++-------------------
> 
> Hi Dan,
> 
> I got about halfway through it and spotted something odd:
> 
> > diff --git a/src/remote_internal.c b/src/remote_internal.c
> ...
> >  static int
> >  remoteDomainGetSchedulerParameters (virDomainPtr domain,
> >                                      virSchedParameterPtr params, int *nparams)
> ...
> > +cleanup:
> >      xdr_free ((xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret);
> > -    return 0;
> > +    if (rv != 0) {
> > +        for ( ; i >= 0 ; i--)
> > +            VIR_FREE(params[i].field);
> > +    }
> > +
> > +done:
> > +    return rv;
> >  }
> 
> Freeing the .field member looks bogus.

Hmmm, not sure why I added that - I must have been thinking it was a
malloc'd char * at the time. Clearly bogus

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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