]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
ddns: avoid unnecessary node shallow copy when removing whole
authorLibor Peltan <libor.peltan@nic.cz>
Wed, 13 Feb 2019 12:36:01 +0000 (13:36 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Fri, 26 Apr 2019 12:39:58 +0000 (14:39 +0200)
src/knot/updates/ddns.c

index ad874274271e4dec06e0c0e8e900b36eebf4cd05..341c9397f3ea0ab57244a418113ee4297fefc4f5 100644 (file)
@@ -554,24 +554,16 @@ static int process_rem_node(const knot_rrset_t *rr,
                return KNOT_EOK;
        }
 
-       zone_node_t *node_copy = node_shallow_copy(node, NULL);
-       if (node_copy == NULL) {
-               return KNOT_ENOMEM;
-       }
-
        // Remove all RRSets from node
-       size_t rrset_count = node_copy->rrset_count;
+       size_t rrset_count = node->rrset_count;
        for (int i = 0; i < rrset_count; ++i) {
-               knot_rrset_t rrset = node_rrset_at(node_copy, rrset_count - i - 1);
-               int ret = process_rem_rrset(&rrset, node_copy, update);
+               knot_rrset_t rrset = node_rrset_at(node, rrset_count - i - 1);
+               int ret = process_rem_rrset(&rrset, node, update);
                if (ret != KNOT_EOK) {
-                       node_free(node_copy, NULL);
                        return ret;
                }
        }
 
-       node_free(node_copy, NULL);
-
        return KNOT_EOK;
 }