aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src/ChannelEndPoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp/src/ChannelEndPoint.cpp')
-rw-r--r--nxcomp/src/ChannelEndPoint.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp
index 8cc0c1d41..843bf2b35 100644
--- a/nxcomp/src/ChannelEndPoint.cpp
+++ b/nxcomp/src/ChannelEndPoint.cpp
@@ -54,6 +54,12 @@ ChannelEndPoint::~ChannelEndPoint()
if(S_ISSOCK(st.st_mode))
unlink(unixPath);
}
+ free(unixPath);
+ unixPath = NULL;
+ free(defaultUnixPath_);
+ defaultUnixPath_ = NULL;
+ free(spec_);
+ spec_ = NULL;
}
void
@@ -90,12 +96,12 @@ void
ChannelEndPoint::setSpec(const char *hostName, long port) {
int length;
- free(spec_);
- spec_ = NULL;
-
isUnix_ = false;
isTCP_ = false;
+ free(spec_);
+ spec_ = NULL;
+
if (hostName && strlen(hostName) && port >= 1)
{
length = snprintf(NULL, 0, "tcp:%s:%ld", hostName, port);
@@ -195,7 +201,7 @@ ChannelEndPoint::getPort(long *port) const {
bool
ChannelEndPoint::getUnixPath(char **unixPath) const {
- if (unixPath) *unixPath = 0;
+ if (unixPath) *unixPath = NULL;
long p;
char *path = NULL;