From: Amos Jeffries Date: Tue, 23 Dec 2008 03:45:29 +0000 (+1300) Subject: Bug 2227: Sefgaults in MemBuf::reset during idnsSendQuery X-Git-Tag: SQUID_3_0_STABLE11~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1e7e5be5a67fd9c80e0d1a38d3910c7dceda5d1;p=thirdparty%2Fsquid.git Bug 2227: Sefgaults in MemBuf::reset during idnsSendQuery --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index e179173457..3e41419b37 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -730,7 +730,9 @@ idnsVCClosed(int fd, void *data) { nsvc * vc = (nsvc *)data; delete vc->queue; + vc->queue = NULL; delete vc->msg; + vc->msg = NULL; nameservers[vc->ns].vc = NULL; cbdataFree(vc); } @@ -783,6 +785,11 @@ idnsSendQueryVC(idns_query * q, int ns) return; } + if(vc->queue == NULL) { + vc->queue = new MemBuf; + vc->queue->init(); + } + vc->queue->reset(); short head = htons(q->sz);