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

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> On Wed, Jan 14, 2009 at 10:41:50PM +0000, Daniel P. Berrange wrote:
>> On Wed, Jan 14, 2009 at 08:39:02PM +0100, Jim Meyering wrote:
>> > "Daniel P. Berrange" <berrange@xxxxxxxxxx> 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
>
> Updated to remove that bogus chunk.

ACK to that.
I confirmed it removes just those 6 lines and
updated the git patch to match.

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