Commit 2eeba86c authored by Jan Kadlec's avatar Jan Kadlec

Merge branch 'reduce_rrset_copying' of /git/repositories/labs/knot

parents 0f8d1c8f 020c55b3
...@@ -1101,18 +1101,11 @@ static int do_checks_in_tree(knot_node_t *node, void *data) ...@@ -1101,18 +1101,11 @@ static int do_checks_in_tree(knot_node_t *node, void *data)
{ {
dbg_semcheck_verb("semcheck: do_check_in_tree: Checking node: %s\n", dbg_semcheck_verb("semcheck: do_check_in_tree: Checking node: %s\n",
knot_dname_to_str(node->owner)); knot_dname_to_str(node->owner));
assert(data != NULL);
arg_t *args = (arg_t *)data;
knot_rrset_t **rrsets = knot_node_get_rrsets(node);
short count = knot_node_rrset_count(node);
assert(count == 0 || rrsets != NULL); arg_t *args = (arg_t *)data;
knot_zone_contents_t *zone = (knot_zone_contents_t *)args->arg1; knot_zone_contents_t *zone = (knot_zone_contents_t *)args->arg1;
assert(zone);
knot_node_t **last_node = (knot_node_t **)args->arg5; knot_node_t **last_node = (knot_node_t **)args->arg5;
err_handler_t *handler = (err_handler_t *)args->arg6; err_handler_t *handler = (err_handler_t *)args->arg6;
...@@ -1129,7 +1122,6 @@ static int do_checks_in_tree(knot_node_t *node, void *data) ...@@ -1129,7 +1122,6 @@ static int do_checks_in_tree(knot_node_t *node, void *data)
int check_level = 1 + (zone_is_secure(zone) ? 1 : 0); int check_level = 1 + (zone_is_secure(zone) ? 1 : 0);
sem_check_node_plain(zone, node, check_level, handler, 1, sem_check_node_plain(zone, node, check_level, handler, 1,
(int *)args->arg7); (int *)args->arg7);
free(rrsets);
return KNOT_EOK; return KNOT_EOK;
} }
...@@ -1138,7 +1130,6 @@ static int do_checks_in_tree(knot_node_t *node, void *data) ...@@ -1138,7 +1130,6 @@ static int do_checks_in_tree(knot_node_t *node, void *data)
handler, do_checks == 3); handler, do_checks == 3);
} }
free(rrsets);
return KNOT_EOK; return KNOT_EOK;
} }
...@@ -1146,7 +1137,7 @@ int zone_do_sem_checks(knot_zone_contents_t *zone, int do_checks, ...@@ -1146,7 +1137,7 @@ int zone_do_sem_checks(knot_zone_contents_t *zone, int do_checks,
err_handler_t *handler, knot_node_t *first_nsec3_node, err_handler_t *handler, knot_node_t *first_nsec3_node,
knot_node_t *last_nsec3_node) knot_node_t *last_nsec3_node)
{ {
if (!handler) { if (!zone || !handler) {
return KNOT_EINVAL; return KNOT_EINVAL;
} }
knot_node_t *last_node = NULL; knot_node_t *last_node = NULL;
......
...@@ -1625,7 +1625,7 @@ static int knot_ddns_process_rem_all(knot_node_t *node, ...@@ -1625,7 +1625,7 @@ static int knot_ddns_process_rem_all(knot_node_t *node,
* \todo Should document this!! * \todo Should document this!!
*/ */
int ret = 0; int ret = 0;
knot_rrset_t **rrsets = knot_node_get_rrsets(node); const knot_rrset_t **rrsets = knot_node_rrsets_no_copy(node);
int count = knot_node_rrset_count(node); int count = knot_node_rrset_count(node);
if (rrsets == NULL && count != 0) { if (rrsets == NULL && count != 0) {
...@@ -1652,13 +1652,10 @@ static int knot_ddns_process_rem_all(knot_node_t *node, ...@@ -1652,13 +1652,10 @@ static int knot_ddns_process_rem_all(knot_node_t *node,
if (ret != KNOT_EOK) { if (ret != KNOT_EOK) {
dbg_ddns("Failed to remove RRSet: %s\n", dbg_ddns("Failed to remove RRSet: %s\n",
knot_strerror(ret)); knot_strerror(ret));
free(rrsets);
return ret; return ret;
} }
} }
free(rrsets);
return KNOT_EOK; return KNOT_EOK;
} }
......
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