summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJohn Ralls <jralls@ceridwen.us>2013-03-01 10:13:20 -0800
committerJohn Ralls <jralls@ceridwen.us>2013-03-01 10:14:59 -0800
commit54ffc982e96bc4b2484a2611c7dc5cf24c4c4a1a (patch)
treee7604dcac46e6b7abd92ff6cf7825cbb0a934df2 /modules
parentc7cf93778927ba6c59cb7a8627e805a1560890f1 (diff)
downloadgtk+-54ffc982e96bc4b2484a2611c7dc5cf24c4c4a1a.tar.gz
Fix gtkprintbackendcups crash
From trying to call g_list_delete_link with a NULL node or removed_printer_checklist.
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 96f4be4103..8dbc78bf89 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -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)