fixed a small leak

(introduced together with the index functionality and spotted while running with valgrind)