[sr-dev] Does shm_free() make the pointer NULL?
Iñaki Baz Castillo
ibc at aliax.net
Tue Feb 28 20:28:00 CET 2012
2012/2/28 Ovidiu Sas <osas at voipembedded.com>:
> You pass the value of a pointer, not the address of a pointer and
> therefore it cannot be set to NULL.
> You need to check if the shm_malloc is successful and before calling
> shm_free, you should check the value of the pointer.
> Also, it is always good to set the pointer to NULL after a shm_free to
> avoid dangling pointers.
Understood. That is exactly how it is now (will commit it right now).
Thanks a lot.
--
Iñaki Baz Castillo
<ibc at aliax.net>
More information about the sr-dev
mailing list