Blob Blame History Raw
From 319dadd4b39ed03271848ca649e4d76de0fbf8ff Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sun, 21 Feb 2016 22:27:01 +0100
Subject: [PATCH] networkd: make sure we allocate the NTA set before we add
 items to it

See: #2683
(cherry picked from commit cbbf38aefc7a3d18d68f0d8fffb6b59d77948690)
---
 src/network/networkd-network.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 4315790093..54f76fe206 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -994,6 +994,10 @@ int config_parse_dnssec_negative_trust_anchors(
                         continue;
                 }
 
+                r = set_ensure_allocated(&n->dnssec_negative_trust_anchors, &dns_name_hash_ops);
+                if (r < 0)
+                        return log_oom();
+
                 r = set_put(n->dnssec_negative_trust_anchors, w);
                 if (r < 0)
                         return log_oom();