simplify free()+set to NULL using av_freep()