Commit 2de4e993 authored by Daniel Salzman's avatar Daniel Salzman

tests/node: fix double free

parent 7ef8196d
/* Copyright (C) 2018 CZ.NIC, z.s.p.o. <>
/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -122,12 +122,9 @@ int main(int argc, char *argv[])
// Test remove RRset
node_remove_rdataset(node, KNOT_RRTYPE_AAAA);
ok(node->rrset_count == 2, "Node: remove non-existent rdataset.");
void *to_free = node_rdataset(node, KNOT_RRTYPE_TXT)->rdata;
node_remove_rdataset(node, KNOT_RRTYPE_TXT);
ok(node->rrset_count == 1, "Node: remove existing rdataset.");
// "Test" freeing
node_free_rrsets(node, NULL);
ok(node->rrset_count == 0, "Node: free RRSets.");
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