aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-27 12:13:43 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-12-29 02:31:26 +0100
commit4107159e218c5d641306acf34abcb7596f63f7a5 (patch)
tree98651fedc1a45deead4c3b7542d72d1fe25f3422
parent604e09686f1f7227cf61e67754d94006c90d29c4 (diff)
downloadnx-libs-4107159e218c5d641306acf34abcb7596f63f7a5.tar.gz
nx-libs-4107159e218c5d641306acf34abcb7596f63f7a5.tar.bz2
nx-libs-4107159e218c5d641306acf34abcb7596f63f7a5.zip
Loop.cpp: free display before leaving SetupDisplaySocket()
fixes a memory leak
-rw-r--r--nxcomp/src/Loop.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index a4c7a95e7..ce1f92a68 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -3877,6 +3877,8 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
cerr << "Error" << ": Invalid display '" << display << "'.\n";
+ delete [] display;
+
HandleCleanup();
}
@@ -3949,6 +3951,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
close(testSocketFD);
addr = (sockaddr *) xServerAddrABSTRACT;
+ delete [] display;
return;
} else {
@@ -4000,6 +4003,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
cerr << "Error" << ": Error " << EGET() << " '" << ESTR()
<< "' checking '" << unixSocketDir << "'.\n";
+ delete [] display;
HandleCleanup();
}
@@ -4048,6 +4052,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
cerr << "Error" << ": Unknown display host '" << display
<< "'.\n";
+ delete [] display;
HandleCleanup();
}