Re: Re: libspf2 memory corruption (?)

Eugene Crosser <[email protected]> Mon, 10 Dec 2007 22:17:42 +0300
Newsgroups gmane.mail.spam.spf.devel
Message-ID <[email protected]>
Frank Ellermann wrote:
> Bas Verhoeven wrote:
> 
>>   SPF_response_t *spf_response = NULL;
> 
> It's years that I used C, but from your description I'd test:
> SPF_response_t *spf_response = malloc( sizeof SPF_response_t );

Nothing to do with that

> [spf_compile.c:107] (Thread 0) **FREE_NULL**
>>>                 *datap = realloc(*datap, size);
> 
> Freeing null pointer: *datap

your (debugging) memory allocator is plain wrong here.
From "man -3 realloc":

"If ptr is NULL, the call is equivalent to malloc(size)"

so it is perfectly legal to invoke realloc() with NULL argument, it
should simply work like malloc() in this case.

Eugene

-------------------------------------------
Archives: http://v2.listbox.com/member/archive/1007/=now
RSS Feed: http://v2.listbox.com/member/archive/rss/1007/
Modify Your Subscription: http://v2.listbox.com/member/?member_id=6959932&id_secret=74282634-ed954b
Powered by Listbox: http://www.listbox.com
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHXZDZfrw/cIw6UWkRAsZEAJwLcZM45DwnPqoN7SGxQhHEXoaeHQCgqA0S
WUZB6AVZdkN/ZYSU5RCany0=
=Xu5Q
-----END PGP SIGNATURE-----