It works fine in Valgrind...More memory leaks plugged