diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-07-02 13:40:46 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-07-02 13:40:46 +0200 |
commit | 74b2129e09ee753f952132d317afe5b503fec07e (patch) | |
tree | 64f5a320b00f62c6a91e3210105015efd1e0a741 | |
parent | daaa48108a0156473b4f8d63265df2004977ba93 (diff) | |
download | rdesktop-74b2129e09ee753f952132d317afe5b503fec07e.zip |
Otherwise we would leak the memory on every reconnect (and exit).
-rw-r--r-- | tcp.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -613,6 +613,8 @@ tcp_connect(char *server) void tcp_disconnect(void) { + int i; + if (g_ssl) { if (!g_network_error) @@ -625,6 +627,17 @@ tcp_disconnect(void) TCP_CLOSE(g_sock); g_sock = -1; + + g_in.size = 0; + xfree(g_in.data); + g_in.data = NULL; + + for (i = 0; i < STREAM_COUNT; i++) + { + g_out[i].size = 0; + xfree(g_out[i].data); + g_out[i].data = NULL; + } } char * |