Skip to content

mem_maybedup() can no longer fail

Evan Hunt requested to merge each-mem-maybedup into main

mem_maybedup() calls isc_mem_allocate() if an mctx is supplied, but that can no longer fail, so now the only way mem_maybedup() could return NULL is if it was given a NULL source address by the caller. this commit adds a REQUIRE to prevent that scenario, and cleans up all the calling code that previously checked for NULL return values.

this function is mostly used in rdata tostruct() implementations, so the documentation for dns_rdata_tostruct() has been updated to remove 'ISC_R_NOMEMORY' as a possible return value.

Merge request reports