Fix "Uninitialized variable".
Fix a potential memory leak.