fix sync memory leak on linux