[Spice-commits] gtk/win-usb-dev.c

Christophe Fergau teuf at kemper.freedesktop.org
Fri Sep 5 00:47:24 PDT 2014


 gtk/win-usb-dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f54458db9b0a1801d9e50f396eac121ee7c2a0fd
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Sep 4 11:16:17 2014 +0200

    win-usb: Initialize GError before using it
    
    GError variables must be set to NULL before passing them to a function
    which might set them.
    This fixes the runtime warning reported in rhbz#1138195:
    
    (remote-viewer.exe:3896): 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.
    The overwriting error message was: handle_dev_change: Error getting
    device list from libusb: Other error [-99]

diff --git a/gtk/win-usb-dev.c b/gtk/win-usb-dev.c
index 7e82fb9..14ab7af 100644
--- a/gtk/win-usb-dev.c
+++ b/gtk/win-usb-dev.c
@@ -344,7 +344,7 @@ static void handle_dev_change(GUdevClient *self)
     GUdevDevice *changed_dev = NULL;
     ssize_t dev_count;
     int is_dev_change;
-    GError *err;
+    GError *err = NULL;
     GList *now_devs = NULL;
     GList *llist, *slist; /* long-list and short-list*/
     GList *lit, *sit; /* iterators for long-list and short-list */


More information about the Spice-commits mailing list