Fix a memory leak ( ROOT-6510)