]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Initialize the __res_state structure used for dns purposes
authorMark Michelson <mmichelson@digium.com>
Tue, 1 Apr 2008 17:21:21 +0000 (17:21 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 1 Apr 2008 17:21:21 +0000 (17:21 +0000)
to all 0's prior to using it. This is due to valgrind's complaints
on issue #12284 as well as an excerpt found in "Description" portion
of the online man page found here:

http://www.iti.cs.tu-bs.de/cgi-bin/UNIXhelp/man-cgi?res_nquery+3RESOLV

(pertains to issue #12284 but does not necessarily close it)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112138 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/dns.c

index 2e17f6dd3a1d5d99a328b743130d4f69e8d8a8fc..d57e6227aa9821394367314bca0cf1f8bfbfca3e 100644 (file)
@@ -255,6 +255,7 @@ int ast_search_dns(void *context,
        int res, ret = -1;
 
 #ifdef HAVE_RES_NINIT
+       memset(&dnsstate, 0, sizeof(dnsstate));
        res_ninit(&dnsstate);
        res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
 #else