fix memory leakage of variable token
fix memory leakage of variable p