Blame SOURCES/tigervnc-inetd-crash.patch

cb236d
diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
cb236d
index 5c0e171..c79ad18 100644
cb236d
--- a/unix/xserver/hw/vnc/xvnc.cc
cb236d
+++ b/unix/xserver/hw/vnc/xvnc.cc
cb236d
@@ -352,7 +352,10 @@ static
cb236d
 bool displayNumFree(int num)
cb236d
 {
cb236d
     try {
cb236d
-	network::TcpListener l(NULL, 6000+num);
cb236d
+      // Attempt to create TCPListeners on that port.
cb236d
+      // They go out of scope immediately and are destroyed.
cb236d
+      std::list<network::TcpListener> dummy;
cb236d
+      network::createTcpListeners (&dummy, 0, 6000+num);
cb236d
     } catch (rdr::Exception& e) {
cb236d
 	return false;
cb236d
     }