[X2Go-Commits] [nx-libs] 06/19: Loop.cpp: delete passed object prior to overwriting it

git-admin at x2go.org git-admin at x2go.org
Sat Dec 30 03:35:16 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit c31c54c1b65080b7e68942e8b50dc88b5ce1279b
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Wed Dec 27 12:54:30 2017 +0100

    Loop.cpp: delete passed object prior to overwriting it
---
 nxcomp/src/Loop.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index fa8ba9a..e84896e 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;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list