aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-04-12 13:26:48 +0200
committerRiccardo Spagni <ric@spagni.net>2018-04-12 13:26:48 +0200
commit9ae9f6ada6651d6e7bb44bdf81f51395c7a61632 (patch)
treee6a27f0500837c39b756956eb0d39cc5c49916a6 /src
parentMerge pull request #3574 (diff)
parentcommon: make this build with unbound 1.4.20 (diff)
downloadmonero-9ae9f6ada6651d6e7bb44bdf81f51395c7a61632.tar.xz
Merge pull request #3601
91a61fea common: make this build with unbound 1.4.20 (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/common/dns_utils.cpp2
-rw-r--r--src/common/util.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index 1ecdae8ec..33f60bc3c 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -230,7 +230,7 @@ DNSResolver::DNSResolver() : m_data(new DNSResolverData())
if (use_dns_public)
{
for (const auto &ip: dns_public_addr)
- ub_ctx_set_fwd(m_data->m_ub_context, ip.c_str());
+ ub_ctx_set_fwd(m_data->m_ub_context, string_copy(ip.c_str()));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-udp:"), string_copy("no"));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-tcp:"), string_copy("yes"));
}
diff --git a/src/common/util.cpp b/src/common/util.cpp
index d01da0fb7..1877acb57 100644
--- a/src/common/util.cpp
+++ b/src/common/util.cpp
@@ -527,7 +527,10 @@ std::string get_nix_version_display_string()
{
ub_ctx *ctx = ub_ctx_create();
if (!ctx) return false; // cheat a bit, should not happen unless OOM
- ub_ctx_zone_add(ctx, "monero", "unbound"); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
+ char *monero = strdup("monero"), *unbound = strdup("unbound");
+ ub_ctx_zone_add(ctx, monero, unbound); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
+ free(unbound);
+ free(monero);
// if no threads, bails out early with UB_NOERROR, otherwise fails with UB_AFTERFINAL id already finalized
bool with_threads = ub_ctx_async(ctx, 1) != 0; // UB_AFTERFINAL is not defined in public headers, check any error
ub_ctx_delete(ctx);