diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-04-10 23:37:33 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-04-10 23:43:24 +0100 |
commit | 91a61fea55f3d63b244403aed710d856ebf12def (patch) | |
tree | bc6e0823aa97df58722dc6e575e712ed263d440b /src/common/util.cpp | |
parent | Merge pull request #3512 (diff) | |
download | monero-91a61fea55f3d63b244403aed710d856ebf12def.tar.xz |
common: make this build with unbound 1.4.20
Common on currently used distros
Diffstat (limited to '')
-rw-r--r-- | src/common/util.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |