2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

A pointer returned by isc_mem_strdup() wasn't being checked.

This commit is contained in:
Brian Wellington 2000-08-11 02:11:20 +00:00
parent 3f31c8c295
commit ea52f8cf9c
2 changed files with 8 additions and 4 deletions

View File

@ -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 <config.h>
@ -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);

View File

@ -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 <config.h>
@ -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);