Skip to content
Snippets Groups Projects
Commit 4bf5828b authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Fixed possible invalid read.

- just a hotfix, a proper solution is to get rid of zone_contents->zone link, it's not really needed.
parent b012b84a
No related branches found
No related tags found
No related merge requests found
......@@ -374,7 +374,7 @@ static int zones_zonefile_sync_from_ev(knot_zone_t *zone, zonedata_t *zd)
}
/*!
* \brief Sync chagnes in zone to zonefile.
* \brief Sync changes in zone to zonefile.
*/
int zones_flush_ev(event_t *e)
{
......@@ -1251,11 +1251,14 @@ static int zones_process_update_auth(knot_zone_t *zone,
if (ret != KNOT_EOK) {
log_zone_error("%s: Failed to sign incoming update %s\n",
msg, knot_strerror(ret));
new_contents->zone = zone;
zones_store_changesets_rollback(transaction);
zones_free_merged_changesets(chgsets, sec_chs);
free(fake_zone);
return ret;
}
assert(dnssec_contents);
dnssec_contents->zone = zone;
// Plan zone resign if needed
zonedata_t *zd = (zonedata_t *)zone->data;
......@@ -1264,8 +1267,10 @@ static int zones_process_update_auth(knot_zone_t *zone,
if (ret != KNOT_EOK) {
log_zone_error("%s: Failed to replan zone sign %s\n",
msg, knot_strerror(ret));
new_contents->zone = zone;
zones_store_changesets_rollback(transaction);
zones_free_merged_changesets(chgsets, sec_chs);
free(fake_zone);
return ret;
}
}
......
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