check request is not NULL before free()ing