mirror of https://github.com/FreeRDP/FreeRDP
Fix pf_server_new: pass own copy of proxyConfig (#7328)
* Fix pf_server_new: pass own copy of proxyConfig The lifecycle of proxyConfig passed to pf_server_new is unknown, so pass proxyServer->config copy to modules. * Early free parsed proxyConfig
This commit is contained in:
parent
b3209fe2b9
commit
32994b02f5
|
@ -120,6 +120,8 @@ int main(int argc, char* argv[])
|
|||
pf_server_config_print(config);
|
||||
|
||||
server = pf_server_new(config);
|
||||
pf_server_config_free(config);
|
||||
|
||||
if (!server)
|
||||
goto fail;
|
||||
|
||||
|
@ -133,7 +135,6 @@ int main(int argc, char* argv[])
|
|||
|
||||
fail:
|
||||
pf_server_free(server);
|
||||
pf_server_config_free(config);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -810,8 +810,8 @@ proxyServer* pf_server_new(const proxyConfig* config)
|
|||
if (!pf_config_clone(&server->config, config))
|
||||
goto out;
|
||||
|
||||
server->module = pf_modules_new(FREERDP_PROXY_PLUGINDIR, pf_config_modules(config),
|
||||
pf_config_modules_count(config));
|
||||
server->module = pf_modules_new(FREERDP_PROXY_PLUGINDIR, pf_config_modules(server->config),
|
||||
pf_config_modules_count(server->config));
|
||||
if (!server->module)
|
||||
{
|
||||
WLog_ERR(TAG, "failed to initialize proxy modules!");
|
||||
|
@ -842,7 +842,7 @@ proxyServer* pf_server_new(const proxyConfig* config)
|
|||
server->listener->info = server;
|
||||
server->listener->PeerAccepted = pf_server_peer_accepted;
|
||||
|
||||
if (!pf_modules_add(server->module, pf_config_plugin, (void*)config))
|
||||
if (!pf_modules_add(server->module, pf_config_plugin, (void*)server->config))
|
||||
goto out;
|
||||
|
||||
return server;
|
||||
|
|
Loading…
Reference in New Issue