free all allocated metadata structures