1449. [bug] query_addbestns() didn't handle running out of memory

gracefully.
This commit is contained in:
Mark Andrews 2003-05-15 02:23:20 +00:00
parent 8d39478fe7
commit e5192fd309
2 changed files with 13 additions and 4 deletions

View file

@ -4,6 +4,9 @@
1452. [bug] Bad #ifdef, ISC_RFC2335 -> ISC_RFC2535.
1449. [bug] query_addbestns() didn't handle running out of memory
gracefully.
1448. [bug] Handle empty wildcards labels.
1439. [bug] Named could return NOERROR with certain NOTIFY
@ -87,7 +90,7 @@
1333. [contrib] queryperf now reports a summary of returned
rcodes (-c), rcodes are printed in mnemonic form (-v).
1219. [bug] Set AI_ADDRCONFIG when looking up addresses
1299. [bug] Set AI_ADDRCONFIG when looking up addresses
via getaddrinfo() (affects dig, host, nslookup, rndc
and nsupdate).

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.198.2.11 2003/05/14 06:51:36 marka Exp $ */
/* $Id: query.c,v 1.198.2.12 2003/05/15 02:23:20 marka Exp $ */
#include <config.h>
@ -1934,7 +1934,9 @@ query_addbestns(ns_client_t *client) {
zdb = db;
zfname = fname;
zrdataset = rdataset;
rdataset = NULL;
zsigrdataset = sigrdataset;
sigrdataset = NULL;
dns_db_detachnode(db, &node);
version = NULL;
db = NULL;
@ -1995,7 +1997,8 @@ query_addbestns(ns_client_t *client) {
DNS_SECTION_AUTHORITY);
cleanup:
query_putrdataset(client, &rdataset);
if (rdataset != NULL)
query_putrdataset(client, &rdataset);
if (sigrdataset != NULL)
query_putrdataset(client, &sigrdataset);
if (fname != NULL)
@ -2698,7 +2701,9 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
zdb = db;
zfname = fname;
zrdataset = rdataset;
rdataset = NULL;
zsigrdataset = sigrdataset;
sigrdataset = NULL;
dns_db_detachnode(db, &node);
version = NULL;
db = NULL;
@ -3203,7 +3208,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
/*
* General cleanup.
*/
query_putrdataset(client, &rdataset);
if (rdataset != NULL)
query_putrdataset(client, &rdataset);
if (sigrdataset != NULL)
query_putrdataset(client, &sigrdataset);
if (fname != NULL)