From a87a553349e9d77c68d38285607078a6861ddfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 30 Jun 2017 08:57:06 +0200 Subject: [PATCH] utils: shut up a coverity warning (CID 155456) --- lib/utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils.c b/lib/utils.c index 71f1c848..11cd293d 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -565,7 +565,12 @@ int kr_ranked_rrarray_add(ranked_rr_array_t *array, const knot_rrset_t *rr, entry->cached = false; entry->yielded = false; entry->to_wire = to_wire; - array_push(*array, entry); + if (array_push(*array, entry) < 0) { + /* Silence coverity. It shouldn't be possible to happen, + * due to the array_reserve_mm call above. */ + mm_free(pool, entry); + return kr_error(ENOMEM); + } return to_wire_ensure_unique(array, array->len - 1); } -- 2.22.0