]> Pileus Git - ~andy/gtk/commitdiff
Fix gtkprintbackendcups crash
authorJohn Ralls <jralls@ceridwen.us>
Fri, 1 Mar 2013 18:13:20 +0000 (10:13 -0800)
committerJohn Ralls <jralls@ceridwen.us>
Fri, 1 Mar 2013 18:14:59 +0000 (10:14 -0800)
From trying to call g_list_delete_link with a NULL node or
removed_printer_checklist.

modules/printbackends/cups/gtkprintbackendcups.c

index 96f4be410339f04b3511a8c49b127278aad3a007..8dbc78bf8955a8db7760bdc9e1f0a72601f92420 100644 (file)
@@ -2067,11 +2067,15 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
         }
 
       /* remove name from checklist if it was found */
-      node = g_list_find_custom (removed_printer_checklist,
-                                info->printer_name,
-                                (GCompareFunc) find_printer);
-      removed_printer_checklist = g_list_delete_link (removed_printer_checklist,
-                                                     node);
+      if (removed_printer_checklist != NULL)
+      {
+          if (node = g_list_find_custom (removed_printer_checklist,
+                                         info->printer_name,
+                                         (GCompareFunc) find_printer))
+               removed_printer_checklist =
+                    g_list_delete_link (removed_printer_checklist,
+                                        node);
+      }
 
       printer = gtk_print_backend_find_printer (backend, info->printer_name);
       if (!printer)