From ea52f8cf9c1fff25ad5ba20f9fd9a8df79d1ef43 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 11 Aug 2000 02:11:20 +0000 Subject: [PATCH] A pointer returned by isc_mem_strdup() wasn't being checked. --- bin/named/aclconf.c | 6 ++++-- lib/dns/aclconf.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/named/aclconf.c b/bin/named/aclconf.c index 0dfe8d7fe2..32a897c99a 100644 --- a/bin/named/aclconf.c +++ b/bin/named/aclconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aclconf.c,v 1.21 2000/08/11 01:53:47 gson Exp $ */ +/* $Id: aclconf.c,v 1.22 2000/08/11 02:11:20 bwelling Exp $ */ #include @@ -62,7 +62,7 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, { if (strcmp(aclname, dacl->name) == 0) { dns_acl_attach(dacl, target); - return ISC_R_SUCCESS; + return (ISC_R_SUCCESS); } } /* Not yet converted. Convert now. */ @@ -77,6 +77,8 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, if (result != ISC_R_SUCCESS) return (result); dacl->name = isc_mem_strdup(dacl->mctx, aclname); + if (dacl->name == NULL) + return (ISC_R_NOMEMORY); ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache); dns_acl_attach(dacl, target); return (ISC_R_SUCCESS); diff --git a/lib/dns/aclconf.c b/lib/dns/aclconf.c index 0dfe8d7fe2..32a897c99a 100644 --- a/lib/dns/aclconf.c +++ b/lib/dns/aclconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aclconf.c,v 1.21 2000/08/11 01:53:47 gson Exp $ */ +/* $Id: aclconf.c,v 1.22 2000/08/11 02:11:20 bwelling Exp $ */ #include @@ -62,7 +62,7 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, { if (strcmp(aclname, dacl->name) == 0) { dns_acl_attach(dacl, target); - return ISC_R_SUCCESS; + return (ISC_R_SUCCESS); } } /* Not yet converted. Convert now. */ @@ -77,6 +77,8 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, if (result != ISC_R_SUCCESS) return (result); dacl->name = isc_mem_strdup(dacl->mctx, aclname); + if (dacl->name == NULL) + return (ISC_R_NOMEMORY); ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache); dns_acl_attach(dacl, target); return (ISC_R_SUCCESS);