aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Gschwind <gschwind@gnu-log.net>2019-08-24 23:18:53 +0200
committerBenoit Gschwind <gschwind@gnu-log.net>2019-08-24 23:21:13 +0200
commit8e09912f9d66e5bef8146040b366286c661e3b53 (patch)
tree90c3cdd96e7b2f53af70754b392ad2edb88d6191
parentae5d92e1a9bf39692095cb54ec7637fc68781408 (diff)
downloadtigervnc-8e09912f9d66e5bef8146040b366286c661e3b53.tar.gz
tigervnc-8e09912f9d66e5bef8146040b366286c661e3b53.zip
fix to early remove of iterator in VNCServerST::removeSocket
-rw-r--r--common/rfb/VNCServerST.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index a3655bca..a764f1bc 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -165,8 +165,6 @@ void VNCServerST::removeSocket(network::Socket* sock) {
std::list<VNCSConnectionST*>::iterator ci;
for (ci = clients.begin(); ci != clients.end(); ci++) {
if ((*ci)->getSock() == sock) {
- clients.remove(*ci);
-
// - Remove any references to it
if (pointerClient == *ci)
pointerClient = NULL;
@@ -182,6 +180,8 @@ void VNCServerST::removeSocket(network::Socket* sock) {
// - Delete the per-Socket resources
delete *ci;
+ clients.remove(*ci);
+
CharArray name;
name.buf = sock->getPeerEndpoint();
connectionsLog.status("closed: %s", name.buf);