[PATCH spice-gtk] channel: clear channel error after auth error

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

 



When entered authentication details are wrong, spice-gtk will reset
channel error, which will result in the following warning:

(remote-viewer:20753): GLib-WARNING **: GError set over the top of a
previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL
before it's set.

Clear channel error after reporting authentication error.
---
 gtk/spice-channel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index c00bb42..fb7b0d5 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2180,8 +2180,10 @@ static gboolean spice_channel_delayed_unref(gpointer data)
 
     g_return_val_if_fail(c->coroutine.coroutine.exited == TRUE, FALSE);
 
-    if (c->state == SPICE_CHANNEL_STATE_FAILED_AUTHENTICATION)
+    if (c->state == SPICE_CHANNEL_STATE_FAILED_AUTHENTICATION) {
         g_coroutine_signal_emit(channel, signals[SPICE_CHANNEL_EVENT], 0, SPICE_CHANNEL_ERROR_AUTH);
+        g_clear_error(&c->error);
+    }
 
     g_object_unref(G_OBJECT(data));
 
-- 
2.1.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]