fix leak in pattern actions