diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-12-27 12:54:30 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2017-12-29 02:31:26 +0100 |
commit | c31c54c1b65080b7e68942e8b50dc88b5ce1279b (patch) | |
tree | 0a73dd527ad7cd4914558dc38cb3281b35e384ba | |
parent | c48748ba0929a488437d85732032aef78528093b (diff) | |
download | nx-libs-c31c54c1b65080b7e68942e8b50dc88b5ce1279b.tar.gz nx-libs-c31c54c1b65080b7e68942e8b50dc88b5ce1279b.tar.bz2 nx-libs-c31c54c1b65080b7e68942e8b50dc88b5ce1279b.zip |
Loop.cpp: delete passed object prior to overwriting it
-rw-r--r-- | nxcomp/src/Loop.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index fa8ba9a1e..e84896e36 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -3141,6 +3141,9 @@ int InitBeforeNegotiation() // Get ready to open the local display. // + delete xServerAddr; + xServerAddr = NULL; + SetupDisplaySocket(xServerAddrFamily, xServerAddr, xServerAddrLength); } @@ -3780,13 +3783,13 @@ void SetupUnixSocket() // The following is a dumb copy-paste. The // nxcompsh library should offer a better // implementation. +// addr is assumed to have been freed outside // void SetupDisplaySocket(int &addr_family, sockaddr *&addr, unsigned int &addr_length) { addr_family = AF_INET; - addr = NULL; addr_length = 0; char *display; |