i'm making a memory allocation/deallocation function
it's simple
inline void safedealloc ( void *mem )
{
if ( mem ) { free( mem ); mem = NULL; }
}
it's working fine .. however after using it few times with a program
i noticed that when calling it in something like
safedealloc( (char *)name );
safedealloc( (char *)name );
causes error .. name supposed to be null after first call . but it doesn't and the second call with invalid pointer ofc causes error .. why isn't null being assigned to name as it should ?
PS: name is properly allocated using malloc and with valid size and contents