]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
move sane device info into method
authorBastian Dehn <hhaalo@arcor.de>
Sun, 18 Feb 2024 10:10:11 +0000 (11:10 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 18 Feb 2024 10:10:11 +0000 (11:10 +0100)
src/kds_s2000w_net.c

index 8e56ea32b8b70ab774142e5963bd35583a97ba8d..04113ee8b1921cc8de2d92468d28e89aa7a15fc2 100644 (file)
@@ -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";