cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Possible memory leak with FTP and curl_easy_perform() ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 15 Oct 2008 20:08:02 +0200 (CEST)

On Wed, 15 Oct 2008, Jean-François Lavoie wrote:

> Since I am using Visual Studio, I could not find any package for version
> 7.19 and that is why I am still using 7.18.

libcurl is easy to compile yourself, there's no need to wait for someone else
to do it...

> Here is the code with which I can reproduce the leak. As you will see, it
> is the ftpget.c example included in the curl package, which I modified to
> get a smaller file so that it iterates more often. I also added a while
> loop around the curl_easy_perforrm() call. When you run this program, after
> a few iterations (maybe 20), you will notice that the process will take 8 KB
> more memory, and after a few other iterations, 8 KB more again, and so on..

That's not how I proceed to check for leaks.

I make the code run for N iterations and then exit, and then I let my tool of
choice (valgrind) tell me if there was any leaks.

In this case I let it loop 10 laps and nothing was reported. Just in case, I
also ran the test again 40 laps but no leaks then either. I'm doing my tests
on a 7.19.0 version.

Note also that we always check for memory leaks in the autobuilds that run on
numerous hosts and different operating systems on all test cases several times
a day. And they don't indicate any leak either.

So no, I can't see any memory leak with this app!

-- 
  / daniel.haxx.se
Received on 2008-10-15