null check before free-ing pointer