Skip to content
Snippets Groups Projects
Commit 137c063c authored by Libor Peltan's avatar Libor Peltan
Browse files

fix after static analysis

parent 6b216cf0
No related branches found
No related tags found
No related merge requests found
Pipeline #48179 passed with warnings
......@@ -295,7 +295,6 @@ int knot_nsec_chain_iterate_fix(zone_tree_t *old_nodes, zone_tree_t *new_nodes,
while (cmp != 0) {
if (cmp < 0) {
// a node was removed
old_prev = old_curr;
old_curr = it_next1(&old_it, old_first);
ret = callback(new_prev, new_curr, data);
CHECK_RET;
......
......@@ -334,6 +334,11 @@ void zone_tree_it_free(zone_tree_it_t *it)
int zone_tree_delsafe_it_begin(zone_tree_t *tree, zone_tree_delsafe_it_t *it)
{
it->total = zone_tree_count(tree);
if (it->total == 0) {
it->current = 0;
it->nodes = NULL;
return KNOT_EOK;
}
it->nodes = malloc(it->total * sizeof(*it->nodes));
if (it->nodes == NULL) {
return KNOT_ENOMEM;
......
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