[Svace-84168] set NULL after freeing, not to access invalid pointer