Skip to content
Snippets Groups Projects
Commit dad70339 authored by Lubos Slovak's avatar Lubos Slovak Committed by Jan Kadlec
Browse files

Deleting of changesets.

refs #930 @10m
parent 6eee5174
No related branches found
No related tags found
No related merge requests found
......@@ -760,7 +760,38 @@ static int xfrin_changeset_add_soa(xfrin_changeset_t *changeset,
void xfrin_free_changesets(xfrin_changesets_t **changesets)
{
/*! \todo Implement */
if (changesets == NULL || *changesets == NULL) {
return;
}
assert((*changesets)->allocated >= (*changesets)->count);
for (int i = 0; i < (*changesets)->count; ++i) {
xfrin_changeset_t *ch = &(*changesets)->sets[i];
assert(ch->add_allocated >= ch->add_count);
assert(ch->remove_allocated >= ch->remove_count);
assert(ch->allocated >= ch->size);
int j;
for (j = 0; i < ch->add_count; ++j) {
dnslib_rrset_deep_free(&ch->add[j], 1, 1, 1);
}
free(ch->add);
for (j = 0; i < ch->remove_count; ++j) {
dnslib_rrset_deep_free(&ch->add[j], 1, 1, 1);
}
free(ch->remove);
dnslib_rrset_deep_free(&ch->soa_from, 1, 1, 1);
dnslib_rrset_deep_free(&ch->soa_to, 1, 1, 1);
free(ch->data);
}
free((*changesets)->sets);
free(*changesets);
*changesets = NULL;
}
......
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