summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ares_library_init.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ares_library_init.c b/ares_library_init.c
index f0137a1..770e7c2 100644
--- a/ares_library_init.c
+++ b/ares_library_init.c
@@ -101,7 +101,10 @@ int ares_library_init(int flags)
int res;
if (ares_initialized)
- return ARES_SUCCESS;
+ {
+ ares_initialized++;
+ return ARES_SUCCESS;
+ }
ares_initialized++;
if (flags & ARES_LIB_INIT_WIN32)
@@ -122,6 +125,8 @@ void ares_library_cleanup(void)
if (!ares_initialized)
return;
ares_initialized--;
+ if (ares_initialized)
+ return;
if (ares_init_flags & ARES_LIB_INIT_WIN32)
ares_win32_cleanup();