+1604. [bug] A xfrout_ctx_create() failure would result in
+ xfrout_ctx_destroy() being called with a
+ partially initialized structure.
+
1455. [bug] <netaddr> missing from server grammar in
doc/misc/options. [RT #5616]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xfrout.c,v 1.101.2.6 2004/03/09 06:09:20 marka Exp $ */
+/* $Id: xfrout.c,v 1.101.2.7 2004/04/06 00:27:29 marka Exp $ */
#include <config.h>
ISC_TRUE : ISC_FALSE,
&xfr));
stream = NULL;
- db = NULL;
- ver = NULL;
quota = NULL;
CHECK(xfr->stream->methods->first(xfr->stream));
xfr->qname = qname;
xfr->qtype = qtype;
xfr->qclass = qclass;
- xfr->db = db;
- xfr->ver = ver;
- xfr->quota = quota;
- xfr->stream = stream;
+ xfr->db = NULL;
+ xfr->ver = NULL;
+ dns_db_attach(db, &xfr->db);
+ dns_db_attachversion(db, ver, &xfr->ver);
xfr->end_of_stream = ISC_FALSE;
xfr->tsigkey = tsigkey;
xfr->lasttsig = lasttsig;
xfr->many_answers = many_answers,
xfr->sends = 0;
xfr->shuttingdown = ISC_FALSE;
+ xfr->buf.base = NULL;
+ xfr->buf.length = 0;
+ xfr->txmem = NULL;
+ xfr->txmemlen = 0;
+ xfr->stream = NULL;
+ xfr->quota = NULL;
/*
* Allocate a temporary buffer for the uncompressed response
*/
xfr->client->shutdown = xfrout_client_shutdown;
xfr->client->shutdown_arg = xfr;
+ /*
+ * These MUST be after the last "goto failure;" / CHECK to
+ * prevent a double free by the caller.
+ */
+ xfr->quota = quota;
+ xfr->stream = stream;
*xfrp = xfr;
return (ISC_R_SUCCESS);