2016-04-11 Florian Weimer [BZ #19865] * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Restore original buffer before retry. Index: glibc-2.23/resolv/nss_dns/dns-canon.c =================================================================== --- glibc-2.23.orig/resolv/nss_dns/dns-canon.c +++ glibc-2.23/resolv/nss_dns/dns-canon.c @@ -144,6 +144,13 @@ _nss_dns_getcanonname_r (const char *nam ptr += sizeof (uint16_t) + __ns_get16 (ptr); } } + + /* Restore original buffer before retry. */ + if (ansp.ptr != buf) + { + free (ansp.ptr); + ansp.ptr = buf; + } } out: