fix memory leak & possibly free() before use