[Spice-devel] [PATCH spice-xpi] controller: initialize correctly Connect() loop condition

Marc-André Lureau marcandre.lureau at gmail.com
Tue May 24 13:12:30 PDT 2011


Without initialization of rc, it may happen connection with controller
socket just don't happen and the client will wait hanging...
---
 SpiceXPI/src/plugin/controller.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp
index a3edccb..3a78b5c 100644
--- a/SpiceXPI/src/plugin/controller.cpp
+++ b/SpiceXPI/src/plugin/controller.cpp
@@ -125,7 +125,7 @@ int SpiceController::Connect(const int nRetries)
     if (nRetries < 0)
         return -1;
 
-    int rc;
+    int rc = -1;
     int sleep_time = 0;
 
     // try to connect for specified count
-- 
1.7.5.1



More information about the Spice-devel mailing list