commit 6334134d4dfe69a4a92822354595d3291307dc9b
Author: Vladimír Čunát <vladimir.cunat@nic.cz>
Date:   Wed Dec 4 13:56:39 2019 +0100

    lib/utils kr_ranked_rrarray_finalize(): ENOMEM -> abort()
    
    See the in-code comments.  Thanks to Seth Arnold.

diff --git a/lib/utils.c b/lib/utils.c
index 140e8ecb..b090b62d 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -833,9 +833,12 @@ int kr_ranked_rrarray_finalize(ranked_rr_array_t *array, uint32_t qry_uid, knot_
 			knot_rdataset_t *rds = &stashed->rr->rrs;
 			knot_rdataset_t tmp = *rds;
 			int ret = knot_rdataset_copy(rds, &tmp, pool);
-			if (ret) {
-				return kr_error(ret);
-			}
+			if (ret) abort();
+			/* ^^ ENOMEM, almost surely.
+			 * The issue here is that it's quite difficult to *safely*
+			 * recover from the situation here (unfinalized elements),
+			 * and apparently we're unable to handle all ENOMEMs anyway.
+			 */
 		} else {
 			/* Multiple RRs; first: sort the array. */
 			stashed->rr->additional = NULL;
@@ -863,9 +866,8 @@ int kr_ranked_rrarray_finalize(ranked_rr_array_t *array, uint32_t qry_uid, knot_
 			#endif
 			if (size_sum) {
 				rds->rdata = mm_alloc(pool, size_sum);
-				if (!rds->rdata) {
-					return kr_error(ENOMEM);
-				}
+				if (!rds->rdata) abort();
+				/* ^^ ENOMEM, see above. */
 			} else {
 				rds->rdata = NULL;
 			}
