diff --git a/test/extensions/geoip_providers/maxmind/geoip_provider_test.cc b/test/extensions/geoip_providers/maxmind/geoip_provider_test.cc index 6d3e8961d82a..14bb46184314 100644 --- a/test/extensions/geoip_providers/maxmind/geoip_provider_test.cc +++ b/test/extensions/geoip_providers/maxmind/geoip_provider_test.cc @@ -94,7 +94,6 @@ class GeoipProviderTestBase { Registry::FactoryRegistry::getFactory( "envoy.geoip_providers.maxmind")); ASSERT(provider_factory_); - on_changed_cbs_.reserve(1); } ~GeoipProviderTestBase() { @@ -116,6 +115,7 @@ class GeoipProviderTestBase { Filesystem::Watcher::OnChangedCb cb) { { absl::WriterMutexLock lock(&mutex_); + on_changed_cbs_.reserve(1); on_changed_cbs_.emplace_back(std::move(cb)); } if (conditional.has_value()) {