Maybe the answer is in the valgrind logs, its alot to read. But isn't it possible to put a write breakpoint in the accounts arrays and step through the code until a zero is written.