Skip to content
Snippets Groups Projects
Commit 04bc2895 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Fixed minor issues in RRL tests.

parent b15bb59e
No related branches found
No related tags found
No related merge requests found
......@@ -297,6 +297,10 @@ static void rrl_log_state(const sockaddr_t *a, uint16_t flags, uint8_t cls)
rrl_table_t *rrl_create(size_t size)
{
if (size == 0) {
return NULL;
}
const size_t tbl_len = sizeof(rrl_table_t) + size * sizeof(rrl_item_t);
rrl_table_t *t = malloc(tbl_len);
if (!t) return NULL;
......
......@@ -125,7 +125,11 @@ static int rrl_tests_run(int argc, char *argv[])
qst.qname = knot_dname_new_from_str("beef.", 5, NULL);
knot_packet_t *query = knot_packet_new(KNOT_PACKET_PREALLOC_QUERY);
knot_query_init(query);
knot_packet_set_max_size(query, 512);
if (knot_packet_set_max_size(query, 512) < 0) {
knot_dname_free(&qst.qname);
knot_packet_free(&query);
return KNOT_ERROR; /* Fatal */
}
knot_query_set_question(query, &qst);
/* Prepare response */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment