mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-core: fix settings->HomePath leak (issue #810)
This commit is contained in:
parent
47b98ec00e
commit
26492f1cc7
|
@ -450,6 +450,7 @@ void freerdp_settings_free(rdpSettings* settings)
|
|||
key_free(settings->RdpServerRsaKey);
|
||||
free(settings->ConfigPath);
|
||||
free(settings->CurrentPath);
|
||||
free(settings->HomePath);
|
||||
freerdp_device_collection_free(settings);
|
||||
freerdp_static_channel_collection_free(settings);
|
||||
freerdp_dynamic_channel_collection_free(settings);
|
||||
|
|
|
@ -85,8 +85,16 @@ BOOL freerdp_check_file_exists(char* file)
|
|||
|
||||
char* freerdp_get_home_path(rdpSettings* settings)
|
||||
{
|
||||
char* home_env = NULL;
|
||||
|
||||
if (settings->HomePath == NULL)
|
||||
settings->HomePath = getenv(HOME_ENV_VARIABLE);
|
||||
{
|
||||
home_env = getenv(HOME_ENV_VARIABLE);
|
||||
|
||||
if (home_env)
|
||||
settings->HomePath = _strdup(home_env);
|
||||
}
|
||||
|
||||
if (settings->HomePath == NULL)
|
||||
settings->HomePath = _strdup("/");
|
||||
|
||||
|
|
Loading…
Reference in New Issue