Fix a possible memory leak