free prev segment and prev residue in json