aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-11-27 23:31:35 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-09 13:15:35 +0100
commit21c742d25361e7ae2dc40f635890f60e6eb0e1d6 (patch)
tree4a4f21d248dee27c1c1f3c55763be99e12e8789d /nxcomp/src
parent513aa23a714d2ccba388bca41262610c571dcf43 (diff)
downloadnx-libs-21c742d25361e7ae2dc40f635890f60e6eb0e1d6.tar.gz
nx-libs-21c742d25361e7ae2dc40f635890f60e6eb0e1d6.tar.bz2
nx-libs-21c742d25361e7ae2dc40f635890f60e6eb0e1d6.zip
nxcomp: simplify free calls
free() can handle NULL itself
Diffstat (limited to 'nxcomp/src')
-rw-r--r--nxcomp/src/ChannelEndPoint.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp
index 1504046c1..8cc0c1d41 100644
--- a/nxcomp/src/ChannelEndPoint.cpp
+++ b/nxcomp/src/ChannelEndPoint.cpp
@@ -58,7 +58,7 @@ ChannelEndPoint::~ChannelEndPoint()
void
ChannelEndPoint::setSpec(const char *spec) {
- if (spec_) free(spec_);
+ free(spec_);
if (spec && strlen(spec))
{
@@ -90,7 +90,7 @@ void
ChannelEndPoint::setSpec(const char *hostName, long port) {
int length;
- if (spec_) free(spec_);
+ free(spec_);
spec_ = NULL;
isUnix_ = false;
@@ -162,7 +162,7 @@ ChannelEndPoint::setDefaultTCPInterface(int publicInterface) {
void
ChannelEndPoint::setDefaultUnixPath(char *path) {
- if (defaultUnixPath_) free(defaultUnixPath_);
+ free(defaultUnixPath_);
if (path && strlen(path))
defaultUnixPath_ = strdup(path);