diff --git a/backend/lexmark_x2600.c b/backend/lexmark_x2600.c index e8542d2e9..610064ed8 100644 --- a/backend/lexmark_x2600.c +++ b/backend/lexmark_x2600.c @@ -631,13 +631,14 @@ scan_devices(){ const char *lp; num_devices = 0; - if(first_device){ + // -- free existing device we are doning a full re-scan + while (first_device){ + Lexmark_Device *this_device = first_device; + first_device = first_device->next; DBG (2, " free first_device\n"); - free(first_device); + free(this_device); } - first_device = NULL; - fp = sanei_config_open (LEXMARK_X2600_CONFIG_FILE); if (!fp) {