aboutsummaryrefslogtreecommitdiff
path: root/resolv/res_libc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /resolv/res_libc.c
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.bz2
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip
2.5-18.1
Diffstat (limited to 'resolv/res_libc.c')
-rw-r--r--resolv/res_libc.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/resolv/res_libc.c b/resolv/res_libc.c
index 76abca8442..834773c32f 100644
--- a/resolv/res_libc.c
+++ b/resolv/res_libc.c
@@ -70,14 +70,8 @@ res_init(void) {
_res.retry = 4;
if (!(_res.options & RES_INIT))
_res.options = RES_DEFAULT;
- else if (_res.nscount > 0) {
- __res_nclose (&_res); /* Close any VC sockets. */
-
- for (int ns = 0; ns < MAXNS; ns++) {
- free (_res._u._ext.nsaddrs[ns]);
- _res._u._ext.nsaddrs[ns] = NULL;
- }
- }
+ else if (_res.nscount > 0)
+ __res_iclose (&_res, true); /* Close any VC sockets. */
/*
* This one used to initialize implicitly to zero, so unless the app
@@ -103,11 +97,7 @@ __res_maybe_init (res_state resp, int preinit)
if (resp->options & RES_INIT) {
if (__res_initstamp != resp->_u._ext.initstamp) {
if (resp->nscount > 0) {
- __res_nclose (resp);
- for (int ns = 0; ns < MAXNS; ns++) {
- free (resp->_u._ext.nsaddrs[ns]);
- resp->_u._ext.nsaddrs[ns] = NULL;
- }
+ __res_iclose (resp, true);
return __res_vinit (resp, 1);
}
}