src/scanadf.c: Fix segfault when `scanadf -h -d <device>`

scanadf segfaults when printing help for a specific device, because
device handle is closed before `scanadf_exit()`, but not set to NULL.

Fixes Fedora bugzilla 2225209
merge-requests/13/merge
Zdenek Dohnal 2023-07-26 10:22:31 +02:00
rodzic a7fec47bec
commit 4fa58ef662
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -1672,7 +1672,10 @@ Type ``%s --help -d DEVICE'' to get list of all options for DEVICE.\n\
\n\
List of available devices:", prog_name);
if (device)
{
sane_close(device);
device = NULL;
}
status = sane_get_devices (&device_list, SANE_FALSE);
if (status == SANE_STATUS_GOOD)