mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
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);
|
pf_server_config_print(config);
|
||||||
|
|
||||||
server = pf_server_new(config);
|
server = pf_server_new(config);
|
||||||
|
pf_server_config_free(config);
|
||||||
|
|
||||||
if (!server)
|
if (!server)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
@ -133,7 +135,6 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
pf_server_free(server);
|
pf_server_free(server);
|
||||||
pf_server_config_free(config);
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -810,8 +810,8 @@ proxyServer* pf_server_new(const proxyConfig* config)
|
|||||||
if (!pf_config_clone(&server->config, config))
|
if (!pf_config_clone(&server->config, config))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
server->module = pf_modules_new(FREERDP_PROXY_PLUGINDIR, pf_config_modules(config),
|
server->module = pf_modules_new(FREERDP_PROXY_PLUGINDIR, pf_config_modules(server->config),
|
||||||
pf_config_modules_count(config));
|
pf_config_modules_count(server->config));
|
||||||
if (!server->module)
|
if (!server->module)
|
||||||
{
|
{
|
||||||
WLog_ERR(TAG, "failed to initialize proxy modules!");
|
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->info = server;
|
||||||
server->listener->PeerAccepted = pf_server_peer_accepted;
|
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;
|
goto out;
|
||||||
|
|
||||||
return server;
|
return server;
|
||||||
|
Loading…
Reference in New Issue
Block a user