On Sun, Dec 5, 2010 at 11:12 AM, Joakim Tjernlund
<joakim.tjernl...@transmode.se> wrote:
>>
>> On structure Initialization, LZMA code tries to free the dictionary
>> and probs buffers, also when these are null pointers. Add some
>> check in order to prevent the free on null pointers.
>>
>> Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantell...@idf-hit.com>
>
> Why not move these NULL checks inside LzmaDec_FreeProbs?
> Then you don't have to litter the code with NULL checks
> and LzmaDec_FreeProbs behaves like the standard free() function.

I don't agree with this. We have problem only on initialization and
should be the caller to check if buffer are already allocated (then
free them) or not.
This check is on the "init behavior" and not on "robustness" of free code.

My 2cents.

luigi

>
>  Jocke
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Luigi 'Comio' Mantellini
R&D - Software
Industrie Dial Face S.p.A.
Via Canzo, 4
20068 Peschiera Borromeo (MI), Italy

Tel.: +39 02 5167 2813
Fax: +39 02 5167 2459
web: www.idf-hit.com
mail: luigi.mantell...@idf-hit.com
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to