[vlc-devel] commit: Don't use FREENULL when that's not needed and don' t free NULL just for fun. ( Rémi Duraffort )

xxcv xxcv07 at gmail.com
Thu Sep 18 05:49:12 CEST 2008


Rémi Denis-Courmont wrote:
> Le mercredi 17 septembre 2008 21:27:19 Bill C. Riemers, vous avez écrit :
>   
>> The reason for FREENULL is because not all platforms correctly ignore
>> free(NULL).
>>     
>
> Hmm no. As noted by several others already, VLC's FREENULL() just frees then 
> NULLifies the pointer. Hence, it is mostly useful if the pointer's own 
> storage is not freed immediately afterward. It avoids dangling pointers.
>
>   
>> I hope you are certain all the platforms VLC is built on 
>> do correctly handle free(NULL).
>>     
>
> Such a brain-damaged platform does not deserve to run VLC, and it would be 
> trivial to divert the brain-damaged free() to the wrapper.
>
>   
>> For example, applications I have built with unpatched Microsoft Visual
>> Studio 6.0 will sometimes crash and do other weird things if the program
>> calls free(NULL).  This particular bug was corrected in MVS 6.0 service
>> pack 3.
>>     
>
> *Fortunately*, VLC cannot be compiled with MSVC 6.
>
>   
I totally agree with Rémi. ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080918/bac0ecfe/attachment.html>


More information about the vlc-devel mailing list