[#1376] added a missing clearKeyVal to clean up a memory leak