On Thu, Feb 9, 2012 at 8:14 PM, Jay Sorg <jay.s...@gmail.com> wrote:

> I see this in a commit to memory.c
>
> "Besides "ptr=NULL; free(ptr);" does nothing so no need to check for
> NULL in xfree()"
>
> This is not true, free(NULL); is undefined and can crash!
> I think we have to put the if (ptr != NULL) back in xfree in memory.c.
> Or change everywhere that might pass NULL.
>

There was some discussion on IRC about that, it turns out that the C
standard actually defines that nothing happens on free(NULL), but that a
tiny minority of compilers may not comply with the standard in that regard:
http://stackoverflow.com/questions/1938735/does-freeptr-where-ptr-is-null-corrupt-memory

I honestly don't mind putting it back in. I'll put it back right now

>
> Jay
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Freerdp-devel mailing list
> Freerdp-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freerdp-devel
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to