OpenVPNClient should be responsible for copying of config

This commit is contained in:
Sergey Abramchuk
2019-09-26 13:17:06 +03:00
parent 8d167952b1
commit 7faa96b809
3 changed files with 5 additions and 6 deletions
+3 -3
View File
@@ -24,11 +24,11 @@ OpenVPNClient::~OpenVPNClient() {
if (this->config != nullptr) { delete this->config; }
}
ClientAPI::EvalConfig OpenVPNClient::apply_config(ClientAPI::Config* _Nonnull config) {
ClientAPI::EvalConfig OpenVPNClient::apply_config(const ClientAPI::Config& config) {
if (this->config != nullptr) { delete this->config; }
this->config = config;
this->config = new ClientAPI::Config(config);
return eval_config(*config);
return eval_config(config);
}
bool OpenVPNClient::tun_builder_new() {