From: Bastian Dehn Date: Wed, 15 Jan 2025 20:26:04 +0000 (+0100) Subject: change do not close if not opened X-Git-Tag: v1.0.27^2~6 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=ccab67b804e81ec09734cd361020b54dba78be27;p=sane-kds-s2000w-net.git change do not close if not opened --- diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 647b3bd..dfdd869 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -76,6 +76,10 @@ void _sane_kds_s2000w_net_close(SANE_Handle handle) { debug_printf(ALL, "sane_kds_s2000w_net_close"); + handler* h = (handler*) handle; + if (h->state != OPENED) + return; + kds_s2000w_option_descriptor_free_option_descriptors(); kds_s2000w_handler_close(handle); }