summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-26 18:00:14 +0000
committerYang Tse <yangsita@gmail.com>2009-05-26 18:00:14 +0000
commitcf3301f024dea088612d72a0946273adf4aae902 (patch)
treed6436e96d02e6d3377d516c898e24b8e9fee1d11 /ares_init.c
parent84aa2f8a5dee92d546165b197928b3c124d082c5 (diff)
downloadc-ares-cf3301f024dea088612d72a0946273adf4aae902.tar.gz
c-ares-cf3301f024dea088612d72a0946273adf4aae902.tar.bz2
c-ares-cf3301f024dea088612d72a0946273adf4aae902.zip
Make ares_init(), ares_dup() and ares_init_options() return ARES_ENOTINITIALIZED
if library initialization has not been performed calling ares_library_init().
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ares_init.c b/ares_init.c
index 68aae2d..bd29fe9 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -129,6 +129,9 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
curl_memlimit(atoi(env));
#endif
+ if (ares_library_initialized() != ARES_SUCCESS)
+ return ARES_ENOTINITIALIZED;
+
channel = malloc(sizeof(struct ares_channeldata));
if (!channel) {
*channelptr = NULL;