On 10/02/2011 5:02 PM, Joakim Tjernlund wrote:
>> From: Philip Craig <[email protected]>
>> +   for (rpnt1 = handle->next; rpnt1; rpnt1 = rpnt1_tmp) {
>> +      rpnt1_tmp = rpnt1->next;
>> +      free(rpnt1);
>> +   }
>>     free(handle->init_fini.init_fini);
>>     free(handle);
> 
> This looks good to me too. Could probably be simplified a little though:
> 
>     free(handle->init_fini.init_fini);
> +   for (rpnt1 = handle; rpnt1; rpnt1 = rpnt1_tmp) {
> +      rpnt1_tmp = rpnt1->next;
> +      free(rpnt1);
> +   }
> -    free(handle);
> 
>  Jocke
> 

Yes that works, although for me it is harder to understand, because
the two allocations are performed by different code, and it is
possible for multiple handles to point to the same dependency list.
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to