From 9644342ce8c2ddfd1b83189965971499513dc7b4 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 18 Feb 2024 11:10:11 +0100 Subject: [PATCH] move sane device info into method --- src/kds_s2000w_net.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 8e56ea3..04113ee 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -17,7 +17,6 @@ typedef struct { } readinfo; readinfo read_info; -SANE_Device* device_info = NULL; readinfo* get_read_info() { @@ -48,15 +47,12 @@ SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback debug_printf(ALL, "sane_kds_s2000w_net_init"); *version_code = SANE_VERSION_CODE(1, 0, 0); kds_s2000w_option_descriptor_init_option_descriptors(); - device_info = malloc(sizeof(SANE_Device)); return SANE_STATUS_GOOD; } void _sane_kds_s2000w_net_exit(void) { debug_printf(ALL, "sane_kds_s2000w_net_exit"); - free(device_info); - device_info = NULL; } SANE_Status _sane_kds_s2000w_net_get_devices(SANE_Device*** device_list, @@ -66,6 +62,7 @@ SANE_Status _sane_kds_s2000w_net_get_devices(SANE_Device*** device_list, if (local_only) return SANE_STATUS_NO_MEM; + SANE_Device* device_info = malloc(sizeof(SANE_Device)); device_info->name = "kds_s2000w_net"; device_info->vendor = "Kodak"; device_info->model = "Kodak Alaris s2000w series"; -- 2.39.5