Fixed memory leak in fpSim() C++ code (similarity function)