Fix the memory leak left by the case-sensitivity fix