Fixed freerdp_assistance_parse_address_list

* Return a proper error in case parsing fails.
* Don't duplicate string as we already operate on a duplicate.
This commit is contained in:
Armin Novak 2018-11-22 11:17:13 +01:00
parent 3f655db3c5
commit f904d84638
1 changed files with 3 additions and 10 deletions

View File

@ -179,21 +179,15 @@ static BOOL append_address(rdpAssistanceFile* file, const char* host, const char
return reallocate(file, host, p);
}
static BOOL freerdp_assistance_parse_address_list(rdpAssistanceFile* file, const char* list)
static BOOL freerdp_assistance_parse_address_list(rdpAssistanceFile* file, char* list)
{
BOOL rc = FALSE;
char* p;
char* str;
if (!file || !list)
return FALSE;
str = _strdup(list);
if (!str)
return FALSE;
p = str;
p = list;
while ((p = strchr(p, ';')) != NULL)
{
@ -213,8 +207,7 @@ static BOOL freerdp_assistance_parse_address_list(rdpAssistanceFile* file, const
rc = TRUE;
out:
free(str);
return TRUE;
return rc;
}
static BOOL freerdp_assistance_parse_connection_string1(rdpAssistanceFile* file)