From f904d846386baba0a2015b3a36b6455405f29c77 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 22 Nov 2018 11:17:13 +0100 Subject: [PATCH] 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. --- libfreerdp/common/assistance.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libfreerdp/common/assistance.c b/libfreerdp/common/assistance.c index 12a6adae2..721e4ac94 100644 --- a/libfreerdp/common/assistance.c +++ b/libfreerdp/common/assistance.c @@ -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)