set pointer to NULL after free