]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add for another profiles nulls init option descriptor
authorBastian Dehn <hhaalo@arcor.de>
Fri, 31 Oct 2025 16:04:52 +0000 (17:04 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 31 Oct 2025 16:04:52 +0000 (17:04 +0100)
src/kds_s2000w_option_descriptors.c

index d98ade35c80aac46ca9c1311976298e13881709e..909d3c9aa5f8d7e8105139c73ceb44113ed0d1fd 100644 (file)
@@ -1523,6 +1523,10 @@ SANE_Status _kds_s2000w_option_descriptors_init_min_profile()
        if (descriptors == NULL)
                return SANE_STATUS_NO_MEM;
 
+       for (int i = 0; i < max_option_count; i++) {
+               descriptors[i] = NULL;
+       }
+
        for (int i = 0; i < max_option_count; i++) {
                descriptors[i] = malloc(sizeof(option_descriptor_t));
                if (descriptors[i] == NULL) {
@@ -1568,6 +1572,10 @@ SANE_Status _kds_s2000w_option_descriptors_init_230802_v1_0_36_profile()
        if (descriptors == NULL)
                return SANE_STATUS_NO_MEM;
 
+       for (int i = 0; i < max_option_count; i++) {
+               descriptors[i] = NULL;
+       }
+
        for (int i = 0; i < max_option_count; i++) {
                descriptors[i] = malloc(sizeof(option_descriptor_t));
                if (descriptors[i] == NULL) {