[Dev] [PATCH] fix memory leak in check_path