{
kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_free_option_descriptors");
- SANE_Option_Descriptor* descriptor = NULL;
-
for (int i = 0; i < MAX_OPTION_COUNT; i++) {
- descriptor = kds_s2000w_option_descriptors_get_by_number(i);
-
- if (descriptor->constraint_type == SANE_CONSTRAINT_STRING_LIST) {
- free((void*) descriptor->constraint.string_list);
- descriptor->constraint.string_list = NULL;
+ if (descriptors[i]->descriptor.constraint_type == SANE_CONSTRAINT_STRING_LIST) {
+ free((void*) descriptors[i]->descriptor.constraint.string_list);
+ descriptors[i]->descriptor.constraint.string_list = NULL;
}
- if (descriptor->constraint_type == SANE_CONSTRAINT_WORD_LIST) {
- free((void*) descriptor->constraint.word_list);
- descriptor->constraint.word_list = NULL;
+ if (descriptors[i]->descriptor.constraint_type == SANE_CONSTRAINT_WORD_LIST) {
+ free((void*) descriptors[i]->descriptor.constraint.word_list);
+ descriptors[i]->descriptor.constraint.word_list = NULL;
}
- if (descriptor->constraint_type == SANE_CONSTRAINT_RANGE) {
- free((void*) descriptor->constraint.range);
- descriptor->constraint.range = NULL;
+ if (descriptors[i]->descriptor.constraint_type == SANE_CONSTRAINT_RANGE) {
+ free((void*) descriptors[i]->descriptor.constraint.range);
+ descriptors[i]->descriptor.constraint.range = NULL;
}
free(descriptors[i]);