pcx: convert VLAs to malloc/free