valgrind errors on ESCL backend
$ valgrind scanimage -d escl:http://localhost:60001 -b --format=jpeg --source="Flatbed" --resolution=300
==25001== Memcheck, a memory error detector
==25001== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==25001== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==25001== Command: scanimage -d escl:http://localhost:60001 -b --format=jpeg --source=Flatbed --resolution=300
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F36B: find_valor_of_array_variables (escl_capabilities.c:188)
==25001== by 0x4F0F36B: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F36B: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F36B: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bba9c8 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F36B: find_valor_of_array_variables (escl_capabilities.c:188)
==25001== by 0x4F0F36B: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F36B: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F36B: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F3A6: find_valor_of_array_variables (escl_capabilities.c:191)
==25001== by 0x4F0F3A6: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F3A6: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F3A6: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bbb118 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F3A6: find_valor_of_array_variables (escl_capabilities.c:191)
==25001== by 0x4F0F3A6: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F3A6: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F3A6: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F3E9: find_valor_of_array_variables (escl_capabilities.c:196)
==25001== by 0x4F0F3E9: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F3E9: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F3E9: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bbb648 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F3E9: find_valor_of_array_variables (escl_capabilities.c:196)
==25001== by 0x4F0F3E9: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F3E9: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F3E9: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bbc568 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0EFB7: print_xml_c.isra.0 (escl_capabilities.c:407)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F01E: print_xml_c.isra.0 (escl_capabilities.c:414)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bbf1f8 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F01E: print_xml_c.isra.0 (escl_capabilities.c:414)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001==
==25001== Invalid write of size 8
==25001== at 0x4F0EC39: char_to_array (escl_capabilities.c:97)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F080: print_xml_c.isra.0 (escl_capabilities.c:421)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001== Address 0x4bc1cb8 is 8 bytes inside a block of size 9 alloc'd
==25001== at 0x48B56C0: malloc (vg_replace_malloc.c:306)
==25001== by 0x4F0EC09: char_to_array (escl_capabilities.c:93)
==25001== by 0x4F0F595: find_valor_of_array_variables (escl_capabilities.c:242)
==25001== by 0x4F0F595: find_value_of_int_variables (escl_capabilities.c:290)
==25001== by 0x4F0F595: find_true_variables (escl_capabilities.c:385)
==25001== by 0x4F0F595: print_xml_c.isra.0 (escl_capabilities.c:401)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F080: print_xml_c.isra.0 (escl_capabilities.c:421)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F12D: print_xml_c.isra.0 (escl_capabilities.c:425)
==25001== by 0x4F0F7DF: escl_capabilities (escl_capabilities.c:508)
==25001== by 0x4F0DB6E: sane_escl_open (escl.c:1128)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001==
==25001== Conditional jump or move depends on uninitialised value(s)
==25001== at 0x4F0DF96: max_string_size (escl.c:255)
==25001== by 0x4F0DF96: init_options (escl.c:843)
==25001== by 0x4F0DF96: sane_escl_open (escl.c:1133)
==25001== by 0x48C99D4: sane_dll_open (dll.c:1298)
==25001== by 0x10ACBB: main (scanimage.c:2350)
==25001==
scanimage: rounded value of resolution from 300 to 300
scanimage: rounded value of br-x from 215.899 to 215.899
scanimage: rounded value of br-y from 355.599 to 355.599
Scanning infinity pages, incrementing by 1, numbering from 1
Scanning page 1
scanimage: sane_start: Document feeder out of documents
Batch terminated, 0 pages scanned
==25001==
==25001== HEAP SUMMARY:
==25001== in use at exit: 164,578 bytes in 422 blocks
==25001== total heap usage: 5,258 allocs, 4,836 frees, 550,460 bytes allocated
==25001==
==25001== LEAK SUMMARY:
==25001== definitely lost: 8,856 bytes in 116 blocks
==25001== indirectly lost: 988 bytes in 64 blocks
==25001== possibly lost: 1,352 bytes in 18 blocks
==25001== still reachable: 153,382 bytes in 224 blocks
==25001== of which reachable via heuristic:
==25001== newarray : 1,536 bytes in 16 blocks
==25001== suppressed: 0 bytes in 0 blocks
==25001== Rerun with --leak-check=full to see details of leaked memory
==25001==
==25001== Use --track-origins=yes to see where uninitialised values come from
==25001== For lists of detected and suppressed errors, rerun with: -s
==25001== ERROR SUMMARY: 39 errors from 7 contexts (suppressed: 0 from 0)
Edited by Timo Teräs