diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index fb114e70ab..2d15c481c9 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -899,7 +899,6 @@ dns_message_gettempname(dns_message_t *msg, dns_name_t **item); * * Returns: *\li #ISC_R_SUCCESS -- All is well. - *\li #ISC_R_NOMEMORY -- No item can be allocated. */ isc_result_t @@ -916,7 +915,6 @@ dns_message_gettemprdata(dns_message_t *msg, dns_rdata_t **item); * * Returns: *\li #ISC_R_SUCCESS -- All is well. - *\li #ISC_R_NOMEMORY -- No item can be allocated. */ isc_result_t @@ -934,7 +932,6 @@ dns_message_gettemprdataset(dns_message_t *msg, dns_rdataset_t **item); * * Returns: *\li #ISC_R_SUCCESS -- All is well. - *\li #ISC_R_NOMEMORY -- No item can be allocated. */ isc_result_t @@ -951,7 +948,6 @@ dns_message_gettemprdatalist(dns_message_t *msg, dns_rdatalist_t **item); * * Returns: *\li #ISC_R_SUCCESS -- All is well. - *\li #ISC_R_NOMEMORY -- No item can be allocated. */ void diff --git a/lib/dns/message.c b/lib/dns/message.c index 976f3e78ef..ad36e1887b 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -295,10 +295,6 @@ newrdata(dns_message_t *msg) { if (rdata == NULL) { msgblock = msgblock_allocate(msg->mctx, sizeof(dns_rdata_t), RDATA_COUNT); - if (msgblock == NULL) { - return (NULL); - } - ISC_LIST_APPEND(msg->rdatas, msgblock, link); rdata = msgblock_get(msgblock, dns_rdata_t); @@ -329,19 +325,12 @@ newrdatalist(dns_message_t *msg) { if (rdatalist == NULL) { msgblock = msgblock_allocate(msg->mctx, sizeof(dns_rdatalist_t), RDATALIST_COUNT); - if (msgblock == NULL) { - return (NULL); - } - ISC_LIST_APPEND(msg->rdatalists, msgblock, link); rdatalist = msgblock_get(msgblock, dns_rdatalist_t); } out: - if (rdatalist != NULL) { - dns_rdatalist_init(rdatalist); - } - + dns_rdatalist_init(rdatalist); return (rdatalist); } @@ -355,10 +344,6 @@ newoffsets(dns_message_t *msg) { if (offsets == NULL) { msgblock = msgblock_allocate(msg->mctx, sizeof(dns_offsets_t), OFFSET_COUNT); - if (msgblock == NULL) { - return (NULL); - } - ISC_LIST_APPEND(msg->offsets, msgblock, link); offsets = msgblock_get(msgblock, dns_offsets_t); @@ -2523,9 +2508,6 @@ dns_message_gettempname(dns_message_t *msg, dns_name_t **item) { REQUIRE(item != NULL && *item == NULL); fn = isc_mempool_get(msg->namepool); - if (fn == NULL) { - return (ISC_R_NOMEMORY); - } *item = dns_fixedname_initname(fn); return (ISC_R_SUCCESS); @@ -2537,10 +2519,6 @@ dns_message_gettemprdata(dns_message_t *msg, dns_rdata_t **item) { REQUIRE(item != NULL && *item == NULL); *item = newrdata(msg); - if (*item == NULL) { - return (ISC_R_NOMEMORY); - } - return (ISC_R_SUCCESS); } @@ -2550,7 +2528,6 @@ dns_message_gettemprdataset(dns_message_t *msg, dns_rdataset_t **item) { REQUIRE(item != NULL && *item == NULL); *item = isc_mempool_get(msg->rdspool); - dns_rdataset_init(*item); return (ISC_R_SUCCESS); } @@ -2561,10 +2538,6 @@ dns_message_gettemprdatalist(dns_message_t *msg, dns_rdatalist_t **item) { REQUIRE(item != NULL && *item == NULL); *item = newrdatalist(msg); - if (*item == NULL) { - return (ISC_R_NOMEMORY); - } - return (ISC_R_SUCCESS); }