1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
This commit is contained in:
Jakub Jelinek
2007-07-12 18:26:36 +00:00
parent 7d58530341
commit 0ecb606cb6
6215 changed files with 494638 additions and 305010 deletions

View File

@@ -69,6 +69,7 @@ static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] = "$BINDId: res_query.c,v 8.20 2000/02/29 05:39:12 vixie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
@@ -151,6 +152,7 @@ __libc_res_nquery(res_state statp,
free (buf);
return (n);
}
assert (answerp == NULL || (void *) *answerp == (void *) answer);
n = __libc_res_nsend(statp, buf, n, answer, anslen, answerp);
if (use_malloc)
free (buf);
@@ -163,6 +165,10 @@ __libc_res_nquery(res_state statp,
return (n);
}
if (answerp != NULL)
/* __libc_res_nsend might have reallocated the buffer. */
hp = (HEADER *) *answerp;
if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
#ifdef DEBUG
if (statp->options & RES_DEBUG)