From: Libor Peltan Date: Wed, 13 Feb 2019 12:36:01 +0000 (+0100) Subject: ddns: avoid unnecessary node shallow copy when removing whole X-Git-Tag: v2.9.0~286^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=072e09f83a71b6577db69ba881e45eca574bd018;p=thirdparty%2Fknot-dns.git ddns: avoid unnecessary node shallow copy when removing whole --- diff --git a/src/knot/updates/ddns.c b/src/knot/updates/ddns.c index ad87427427..341c9397f3 100644 --- a/src/knot/updates/ddns.c +++ b/src/knot/updates/ddns.c @@ -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; }