aboutsummaryrefslogtreecommitdiff
path: root/nxcomp
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-27 14:43:22 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-12-29 02:31:26 +0100
commit6d8fe661eb792ff9527d78073e361bb67c3b0ede (patch)
treec65e4e648bf498a3b254acb39769bc12f435896b /nxcomp
parent14a5589186c7cf0ececadedecd3db3125466d22a (diff)
downloadnx-libs-6d8fe661eb792ff9527d78073e361bb67c3b0ede.tar.gz
nx-libs-6d8fe661eb792ff9527d78073e361bb67c3b0ede.tar.bz2
nx-libs-6d8fe661eb792ff9527d78073e361bb67c3b0ede.zip
Loop.cpp: create xServerAddrUNIX only if required
Diffstat (limited to 'nxcomp')
-rw-r--r--nxcomp/src/Loop.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index c6dc3fefe..1bf3a6198 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -3912,10 +3912,7 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
nxinfo << "Loop: Using real X server on UNIX domain socket.\n"
<< std::flush;
- sockaddr_un *xServerAddrUNIX = new sockaddr_un;
-
addr_family = AF_UNIX;
- xServerAddrUNIX -> sun_family = AF_UNIX;
//
// The scope of this function is to fill either the sockaddr_un
@@ -3962,7 +3959,6 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
<< "for accessing DISPLAY=:" << xPort << ".\n";
addr = (sockaddr *) xServerAddrABSTRACT;
- delete xServerAddrUNIX;
delete [] display;
return;
@@ -4035,6 +4031,9 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
nxinfo << "Loop: Assuming X socket name '" << unixSocketName
<< "'.\n" << std::flush;
+ sockaddr_un *xServerAddrUNIX = new sockaddr_un;
+
+ xServerAddrUNIX -> sun_family = AF_UNIX;
strcpy(xServerAddrUNIX -> sun_path, unixSocketName);
addr = (sockaddr *) xServerAddrUNIX;