Years ago we used Microsoft VC++ 1.52C compiler. We had a similar problem and found that malloc() itself cause memory leaks every few hundred calls. We wrote our own malloc() function and the problem disappeared.
You might write a small test program to see if malloc() is doing something similar with your compiler and operating system.