fix memory leak in lookup process
Merge branch 'master' into portable