How can it possibly know where the leak happens? If it could guess that, it could write the program for you. Valgrind is a very useful tool but it's not magical.
Does valgrind report the memory as "definitely lost," "possibly lost," or what? What does the line of code look like?