Commit Graph

6 Commits

Author SHA1 Message Date
David Drysdale f1bcfa1122 api: Allow injection of user-specified malloc/free functions
Add a new ares_library_init_mem() initialization function for the
library which allows the library user to specify their own malloc,
realloc & free equivalents for use library-wide.

Store these function pointers in library-wide global variables,
defaulting to libc's malloc(), realloc() and free().

Change all calls to malloc, realloc and free to use the function pointer
instead.  Also ensure that ares_strdup() is always available
(even if the local environment includes strdup(3)), and change the
library code to always use it.

Convert calls to calloc() to use ares_malloc() + memset
2016-02-02 10:05:07 +00:00
Patrick Valsecchi 148c8e0353 protocol parsing: check input data stricter
... so that bad length fields aren't blindly accepted

Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml
2013-04-15 22:28:01 +02:00
Yang Tse 0c677f578e setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>
Inclusion of these two header files now done in setup_once.h
2012-12-14 18:36:59 +01:00
Yang Tse a1035276c1 Header inclusion clean-up
Remove header inclusions already done in setup_once.h
2012-12-14 18:25:56 +01:00
Daniel Stenberg 2d5ed6400b cleanup: avoid unsafe typecasts
Avoid the risk of reading 16bit data from an unaligned address by using
a macro that is adapted for this.
2010-12-18 22:20:16 +01:00
Jérémy Lal 63918fca76 added ares_parse_mx_reply 2010-04-18 00:29:26 +02:00