[bugfix] fixed memory leak in read_raw_segment