Commit 95edeb40 authored by Vladimír Čunát's avatar Vladimír Čunát

Merge !322: coverity fixes (nothing important)

parents e19ff84f a87a5533
Pipeline #7115 canceled with stages
in 77 minutes and 2 seconds
......@@ -143,6 +143,7 @@ static struct kr_query *kr_rplan_push_query(struct kr_rplan *rplan,
if (parent && (parent->flags & qry->flags & QUERY_FORWARD)) {
ret = kr_nsrep_copy_set(&qry->ns, &parent->ns);
if (ret) {
query_free(rplan->pool, qry);
return NULL;
}
}
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment