Valgrind reported leaks which went away after adding the above line.