From f49bde9e351d5ea69f8fcceb92e87953b41fa2b5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 4 Jul 2005 23:18:31 +0000 Subject: [PATCH] 1895. [bug] fctx_create() could return success even though it failed. [RT #14993] --- CHANGES | 3 +++ lib/dns/resolver.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index e8766413fb..c8a0161663 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1895. [bug] fctx_create() could return success even though it + failed. [RT #14993] + 1893. [cleanup] dighost.c: move external declarations into . 1892. [bug] dnssec-signzone, dnssec-keygen: handle negative debug diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index bee6286cce..8543f5697e 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.218.2.18.4.53 2005/03/16 03:51:08 marka Exp $ */ +/* $Id: resolver.c,v 1.218.2.18.4.54 2005/07/04 23:18:31 marka Exp $ */ #include @@ -2666,7 +2666,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp) { fetchctx_t *fctx; - isc_result_t result = ISC_R_SUCCESS; + isc_result_t result; isc_result_t iresult; isc_interval_t interval; dns_fixedname_t fixed; @@ -2688,8 +2688,10 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, strcat(buf, "/"); /* checked */ strcat(buf, typebuf); /* checked */ fctx->info = isc_mem_strdup(res->mctx, buf); - if (fctx->info == NULL) + if (fctx->info == NULL) { + result = ISC_R_NOMEMORY; goto cleanup_fetch; + } FCTXTRACE("create"); dns_name_init(&fctx->name, NULL); result = dns_name_dup(name, res->mctx, &fctx->name);