diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-12-27 21:13:39 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2017-12-29 02:31:27 +0100 |
commit | 9e8bd2e1b6029ef04dec424fefcdf8842a0daf0f (patch) | |
tree | 8311848fc94a8020dcf34e719ea8f2a70f33a7bc | |
parent | ce293647d5a63726c05260ca0e0f65a50e604ebb (diff) | |
download | nx-libs-9e8bd2e1b6029ef04dec424fefcdf8842a0daf0f.tar.gz nx-libs-9e8bd2e1b6029ef04dec424fefcdf8842a0daf0f.tar.bz2 nx-libs-9e8bd2e1b6029ef04dec424fefcdf8842a0daf0f.zip |
Loop.cpp: fix memleak happening with unknown tcp host
==28424== 6 bytes in 1 blocks are definitely lost in loss record 1 of 7
==28424== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28424== by 0x541D4D9: strndup (strndup.c:43)
==28424== by 0x4E8AD4B: ChannelEndPoint::getTCPHostAndPort(char**, long*) const (ChannelEndPoint.cpp:311)
==28424== by 0x4EBE9CC: ConnectToRemote(ChannelEndPoint&) (Loop.cpp:6656)
==28424== by 0x4EB0A4C: SetupProxyConnection() (Loop.cpp:3205)
==28424== by 0x4EDC81A: handleNegotiationInLoop(int&, fd_set&, fd_set&, timeval&) (Loop.cpp:14308)
==28424== by 0x4EAE40F: NXTransPrepare (Loop.cpp:2576)
==28424== by 0x4EAA801: NXTransContinue (Loop.cpp:1610)
==28424== by 0x4EB50C9: WaitCleanup() (Loop.cpp:4436)
==28424== by 0x4EA9507: NXTransProxy (Loop.cpp:1235)
==28424== by 0x400B2A: main (Main.c:111)
-rw-r--r-- | nxcomp/src/Loop.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index 1e770380f..b0b778a14 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -6482,6 +6482,7 @@ int PrepareProxyConnectionTCP(char** hostName, long int* portNum, int* timeout, cerr << "Error" << ": Unknown remote host '" << *hostName << "'.\n"; + SAFE_FREE(*hostName); HandleCleanup(); } |