summaryrefslogtreecommitdiffstats
path: root/discover/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/network.c')
-rw-r--r--discover/network.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/discover/network.c b/discover/network.c
index 8be07aa..4b9e4f1 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -441,17 +441,18 @@ static void network_init_dns(struct network *network)
memcpy(buf + len, dns_conf, dns_conf_len);
len += dns_conf_len;
modified = true;
- }
- if (!modified)
- return;
+ talloc_free(dns_conf);
+ }
- rc = replace_file("/etc/resolv.conf", buf, len);
- if (rc) {
- pb_log("error replacing resolv.conf: %s\n", strerror(errno));
- return;
+ if (modified) {
+ rc = replace_file("/etc/resolv.conf", buf, len);
+ if (rc)
+ pb_log("error replacing resolv.conf: %s\n",
+ strerror(errno));
}
+ talloc_free(buf);
}
struct network *network_init(void *ctx, struct waitset *waitset, bool dry_run)
OpenPOWER on IntegriCloud