Commit 14e6250a authored by Daniel Salzman's avatar Daniel Salzman

zone: fix possible use after free (Coverity)

parent 48a70a9a
......@@ -526,6 +526,7 @@ static int set_new_soa(zone_update_t *update, unsigned serial_policy)
int ret = zone_update_remove(update, soa_cpy);
if (ret != KNOT_EOK) {
knot_rrset_free(soa_cpy, NULL);
return ret;
}
uint32_t old_serial = knot_soa_serial(&soa_cpy->rrs);
......
......@@ -578,6 +578,7 @@ static int insert_rr(zone_contents_t *z, const knot_rrset_t *rr,
int ret = nsec3 ? add_nsec3_node(z, *n) : add_node(z, *n, true);
if (ret != KNOT_EOK) {
node_free(*n, NULL);
*n = NULL;
}
}
}
......
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