Fix a buffer leak