[sr-dev] shm_free - not setting pointer to zero?

Richard Good richard.good at smilecoms.com
Mon May 28 09:13:46 CEST 2012


Hi

Is there any reason why shm_free does not set the pointer it is freeing to
zero once it is free-ed?

Code like:
*if (pointer) {
            shm_free(pointer);*

Is not really useful seen as how shm_free does not set the pointer to zero
- any double free will still cause a crash.

I suppose it forces the developer to be careful with memory management - is
this the only reason?

Regards
Richard.

This email is subject to the disclaimer of Smile Communications (PTY) Ltd. at http://www.smilecoms.com/disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20120528/89960c86/attachment.htm>


More information about the sr-dev mailing list