Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: reorder SecretManagerImpl field to avoid heap-after-use in te… #4940

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ InstanceImpl::InstanceImpl(Options& options, Event::TimeSystem& time_system,
: options_(options), time_system_(time_system), restarter_(restarter),
start_time_(time(nullptr)), original_start_time_(start_time_), stats_store_(store),
thread_local_(tls), api_(new Api::Impl(options.fileFlushIntervalMsec())),
secret_manager_(std::make_unique<Secret::SecretManagerImpl>()),
dispatcher_(api_->allocateDispatcher(time_system)),
singleton_manager_(new Singleton::ManagerImpl()),
handler_(new ConnectionHandlerImpl(ENVOY_LOGGER(), *dispatcher_)),
random_generator_(std::move(random_generator)),
secret_manager_(std::make_unique<Secret::SecretManagerImpl>()),
listener_component_factory_(*this), worker_factory_(thread_local_, *api_, hooks, time_system),
random_generator_(std::move(random_generator)), listener_component_factory_(*this),
worker_factory_(thread_local_, *api_, hooks, time_system),
dns_resolver_(dispatcher_->createDnsResolver({})),
access_log_manager_(*api_, *dispatcher_, access_log_lock, store), terminated_(false) {

Expand Down
2 changes: 1 addition & 1 deletion source/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ class InstanceImpl : Logger::Loggable<Logger::Id::main>, public Instance {
std::unique_ptr<ServerStats> server_stats_;
ThreadLocal::Instance& thread_local_;
Api::ApiPtr api_;
std::unique_ptr<Secret::SecretManager> secret_manager_;
Event::DispatcherPtr dispatcher_;
std::unique_ptr<AdminImpl> admin_;
Singleton::ManagerPtr singleton_manager_;
Network::ConnectionHandlerPtr handler_;
Runtime::RandomGeneratorPtr random_generator_;
Runtime::LoaderPtr runtime_loader_;
std::unique_ptr<Secret::SecretManager> secret_manager_;
std::unique_ptr<Ssl::ContextManagerImpl> ssl_context_manager_;
ProdListenerComponentFactory listener_component_factory_;
ProdWorkerFactory worker_factory_;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node { id: " " cluster: " " } static_resources { clusters { name: " " connect_timeout { nanos: 4 } hosts { pipe { } } health_checks { timeout { nanos: 4 } interval { nanos: 4 } unhealthy_threshold { } healthy_threshold { } grpc_health_check { } } tls_context { common_tls_context { tls_certificate_sds_secret_configs { sds_config { path: "" } } } } http2_protocol_options { } } }