diff options
Diffstat (limited to 'nxcomp/src')
-rw-r--r-- | nxcomp/src/ChannelEndPoint.cpp | 6 | ||||
-rw-r--r-- | nxcomp/src/Loop.cpp | 2 | ||||
-rw-r--r-- | nxcomp/src/Proxy.cpp | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp index 2abc0ee6a..de881835c 100644 --- a/nxcomp/src/ChannelEndPoint.cpp +++ b/nxcomp/src/ChannelEndPoint.cpp @@ -273,8 +273,10 @@ ChannelEndPoint::getTCPHostAndPort(char **host, long *port) const { char *h = NULL; ssize_t h_len; - if (host) *host = NULL; - if (port) *port = 0; + if (host) + *host = NULL; + if (port) + *port = 0; if (getPort(&p)) { h_len = 0; diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index 3ee094efb..ab7ea5a0f 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -6660,6 +6660,8 @@ int ConnectToRemote(ChannelEndPoint &socketAddress) << " in process with pid '" << getpid() << "'.\n" << std::flush; + SAFE_FREE(hostName); + if (socketAddress.getUnixPath(&unixPath)) result = PrepareProxyConnectionUnix(&unixPath, &connectTimeout, &pFD, &reason); else if (socketAddress.getTCPHostAndPort(&hostName, &portNum)) diff --git a/nxcomp/src/Proxy.cpp b/nxcomp/src/Proxy.cpp index 963ae3d75..71ea090e6 100644 --- a/nxcomp/src/Proxy.cpp +++ b/nxcomp/src/Proxy.cpp @@ -6123,7 +6123,7 @@ int Proxy::handleNewSlaveConnection(int clientFd) int Proxy::handleNewGenericConnectionFromProxy(int channelId, T_channel_type type, ChannelEndPoint &endPoint, const char *label) { - char *unixPath, *host; + char *unixPath, *host = NULL; long port; if (endPoint.getUnixPath(&unixPath)) { |