Try harder to call res_ndestroy().

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19869 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-01-12 16:03:14 +00:00
parent bd62812bd8
commit 0cf980c265

View File

@@ -492,6 +492,14 @@ parse_reply(const unsigned char *data, size_t len)
return r; return r;
} }
#ifdef HAVE_RES_NSEARCH
#ifdef HAVE_RES_NDESTROY
#define rk_res_free(x) res_ndestroy(x)
#else
#define rk_res_free(x) res_nclose(x)
#endif
#endif
static struct dns_reply * static struct dns_reply *
dns_lookup_int(const char *domain, int rr_class, int rr_type) dns_lookup_int(const char *domain, int rr_class, int rr_type)
{ {
@@ -530,7 +538,7 @@ dns_lookup_int(const char *domain, int rr_class, int rr_type)
reply = malloc(size); reply = malloc(size);
if (reply == NULL) { if (reply == NULL) {
#ifdef HAVE_RES_NSEARCH #ifdef HAVE_RES_NSEARCH
res_nclose(&state); rk_res_free(&state);
#endif #endif
return NULL; return NULL;
} }
@@ -548,18 +556,14 @@ dns_lookup_int(const char *domain, int rr_class, int rr_type)
} }
if (len < 0) { if (len < 0) {
#ifdef HAVE_RES_NSEARCH #ifdef HAVE_RES_NSEARCH
#ifdef HAVE_RES_NDESTROY rk_res_free(&state);
res_ndestroy(&state);
#else
res_nclose(&state);
#endif
#endif #endif
free(reply); free(reply);
return NULL; return NULL;
} }
} while (size < len && len < rk_DNS_MAX_PACKET_SIZE); } while (size < len && len < rk_DNS_MAX_PACKET_SIZE);
#ifdef HAVE_RES_NSEARCH #ifdef HAVE_RES_NSEARCH
res_nclose(&state); rk_res_free(&state);
#endif #endif
len = min(len, size); len = min(len, size);