diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index f0f4bebb5..dd8db3813 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -629,11 +629,11 @@ static int cliprdr_server_receive_format_list(CliprdrServerContext* context, wSt for (index = 0; index < formatList.numFormats; index++) { - if (formats[index].formatName) - free(formats[index].formatName); + if (formatList.formats[index].formatName) + free(formatList.formats[index].formatName); } - free(formats); + free(formatList.formats); return 1; } diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index 5c94049c8..b357bc5f5 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -842,7 +842,7 @@ int freerdp_tcp_connect_multi(char** hostnames, int count, int port, int timeout int flags; int maxfds; fd_set cfds; - int sockfd; + int sockfd = -1; int* sockfds; char port_str[16]; socklen_t optlen;