Re: [PATCH 4/7] remote.c: add command line option parser for --lockref
John Keeping <john@keeping.me.uk> writes:
Show 25 quoted lines
> On Tue, Jul 09, 2013 at 12:53:27PM -0700, Junio C Hamano wrote:
>> diff --git a/remote.c b/remote.c
>> index 81bc876..e9b423a 100644
>> --- a/remote.c
>> +++ b/remote.c
>> @@ -1938,3 +1938,62 @@ struct ref *get_stale_heads(struct refspec *refs, int ref_count, struct ref *fet
>> string_list_clear(&ref_names, 0);
>> return stale_refs;
>> }
>> +
>> +/*
>> + * Lockref aka CAS
>> + */
>> +void clear_cas_option(struct push_cas_option *cas)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < cas->nr; i++)
>> + free(cas->entry->refname);
>
> Should this be
>
> free(cas->entry[i]->refname);
>
> ?Yes, more like "free(cas->entry[i].refname)".
Thanks for spotting.
>
>> + free(cas->entry);
>> + memset(cas, 0, sizeof(*cas));
>> +}