[PATCH v2 virt-viewer] rhbz#1007306 - Don't free session if we're re-trying auth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



deactivate() is called in response to a failed authentication attempt. If the
session is cleared here, when a user attempts to re-authenticate, it will issue
a warning and will not actually work. So only clear the session here if we're
not going to re-try authentication.
---

Fix critial warning mentioned by Marc-Andre

 src/virt-viewer-app.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 0369706..efa012a 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1251,7 +1251,6 @@ virt_viewer_app_deactivate(VirtViewerApp *self, gboolean connect_error)
 
     if (priv->session) {
         virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
-        g_clear_object(&priv->session);
     }
 
     priv->connected = FALSE;
@@ -1267,8 +1266,10 @@ virt_viewer_app_deactivate(VirtViewerApp *self, gboolean connect_error)
     if (priv->authretry) {
         priv->authretry = FALSE;
         g_idle_add(virt_viewer_app_retryauth, self);
-    } else
+    } else {
+        g_clear_object(&priv->session);
         virt_viewer_app_deactivated(self, connect_error);
+    }
 
 }
 
-- 
1.8.5.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux