aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-04 14:25:34 -0500
committerJack Lloyd <[email protected]>2018-02-04 14:25:34 -0500
commita17f1b71254e7e4c9de1a86a246fb85a3a4f25b9 (patch)
tree197312b34b1076d4c3f93735b833ec1e290dc59b
parent912f3b6f042855b4983a7ee86250fc670e3738e5 (diff)
Add hack to deal with initialization fiasco
-rw-r--r--src/lib/pubkey/ec_group/ec_group.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp
index ddd7251e2..c5c39b6b3 100644
--- a/src/lib/pubkey/ec_group/ec_group.cpp
+++ b/src/lib/pubkey/ec_group/ec_group.cpp
@@ -171,6 +171,12 @@ class EC_Group_Data_Map final
//static
EC_Group_Data_Map& EC_Group::ec_group_data()
{
+ /*
+ * This exists purely to ensure the allocator is constructed before g_ec_data,
+ * which ensures that its destructor runs after ~g_ec_data is complete.
+ */
+ secure_vector<uint8_t> initialize_allocator(1);
+
static EC_Group_Data_Map g_ec_data;
return g_ec_data;
}