cURL / Mailing Lists / curl-library / Single Mail


Re: Really weird problem with CURLOPT_WRITEFUNCTION

From: Kamil Dudka <>
Date: Thu, 24 Dec 2009 16:12:03 +0100

On Wednesday 23 of December 2009 23:36:46 Joshua McCracken wrote:
> Just checked on that, and it looks like you were right. Saw that gdb
> indicated there was a null pointer dereference, but thought it was because
> It failed to allocate memory and I was using the data at that virtual
> address later on in the code without checking to make sure it wasn't NULL
> first (was planning on worrying about that later). I guess that would also
> explain why it was trying to allocate so much memory, which was what caused
> malloc() to fail in the first place. Should have paid more attention to the
> working implementation, now I see that they declared a pointer to that
> struct and passed it by reference using CURLOPT_WRITEDATA as a param for
> the setopt function. I bet that fixes it.

Wait, you forgot to say how you allocate the struct? dynamically? statically?
on stack?

List admin:
Received on 2009-12-24