libfreerdp-core: fix server-side transport_attach crash
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 13 Feb 2015 13:41:47 +0000 (08:41 -0500)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 13 Feb 2015 13:41:47 +0000 (08:41 -0500)
libfreerdp/core/transport.c

index b5a517d..06a5f9d 100644 (file)
@@ -69,7 +69,11 @@ wStream* transport_send_stream_init(rdpTransport* transport, int size)
 
 void transport_attach(rdpTransport* transport, int sockfd)
 {
+       if (!transport->TcpIn)
+               transport->TcpIn = freerdp_tcp_new(transport->settings);
+
        freerdp_tcp_attach(transport->TcpIn, sockfd);
+
        transport->SplitInputOutput = FALSE;
        transport->frontBio = transport->TcpIn->bufferedBio;
 }