FFMPEG docs say the AVIOContext should be freed with av_free:
http://ffmpeg.org/doxygen/trunk/avio_8h.html#a853f5149136a27ffba3207d8520172a5