Reset last error state after a hostname was resolved successfully.
authorArmin Novak <armin.novak@thincast.com>
Wed, 11 Sep 2019 08:43:17 +0000 (10:43 +0200)
committerArmin Novak <armin.novak@thincast.com>
Wed, 11 Sep 2019 08:43:17 +0000 (10:43 +0200)
libfreerdp/core/tcp.c

index e4a58f2..6bdb307 100644 (file)
@@ -801,6 +801,7 @@ static BOOL freerdp_tcp_is_hostname_resolvable(rdpContext* context, const char*
                return FALSE;
        }
 
+       freerdp_set_last_error(context, 0);
        freeaddrinfo(result);
        return TRUE;
 }
@@ -1127,6 +1128,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
                        char* peerAddress;
                        struct addrinfo* addr;
                        struct addrinfo* result;
+
                        result = freerdp_tcp_resolve_host(hostname, port, 0);
 
                        if (!result)
@@ -1136,6 +1138,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
 
                                return -1;
                        }
+                       freerdp_set_last_error(context, 0);
 
                        addr = result;