cURL / Mailing Lists / curl-library / Single Mail


Re: free() warning from curl library on netbsd 3.0

From: Daniel Stenberg <>
Date: Tue, 14 Aug 2007 14:01:33 +0200 (CEST)

On Tue, 14 Aug 2007, Pradeep wrote:

> I had made the following changes in (7.16.4)url.c - line 1247.
>  if(data->change.url_alloc == TRUE) {
> (This had solved my warning problem.)
> As you said, it is either a bug in libcurl or in my app...
> The value of data->change.url_alloc was 120. What could be the possible
> reason?

Some code wrote to the address of that variable. It could be a buffer
overflow, a dangling pointer or similar. No fine code should ever set that
variable to anything 0 or 1.

> Is there any minimum file size for transfer?

No, that would be utterly silly.

> There seems to be a problem if the file size is very less (~200 bytes).

Not for me or a bazillion of other users...

> I'm reusing the same easy handle for multiple transfers sequentially. I call
> a curl_multi_remove_handle() everytime before adding again to multi handle.
> The subsequent curl_multi_add_handle() returns CURLM_BAD_EASY_HANDLE (only
> when the file size is less than 1KB).

If it returns CURLM_BAD_EASY_HANDLE it does that long before it knows the size
of the upcoming transfer so it really can't be due to that.

But it certainly indicates something seriously wrong.

> Also, running the application for around 3-4hrs will result in a
> segmentation fault at curl_multi_add_handle(). Please help.

That too is seriously wrong.

As usual, please provide a full source code snippet that repeats any or all of
these problems so that we can help tracking them down.

  Commercial curl and libcurl Technical Support:
Received on 2007-08-14