dynamic memory allocation for filename_gz replaced