The legacy libusb produce double free curruption when use with scanimage and hp-firmware. From the libusb bug system, this won't be fixed (legacy version) but a patch exist. Reproducible: Always Steps to Reproduce: 1. Run scanimage Actual Results: Double free corruption
Created attachment 275755 [details, diff] Patch that fixes the memory corruption From: http://www.libusb.org/attachment/ticket/11/libusb_memset_altsetting_alloc.patch
Thanks for pointing out this patch, assigning to maintainer
Comment on attachment 275755 [details, diff] Patch that fixes the memory corruption pretty sure this patch is broken. upstream trac is down, so i can't check that. i think what you actually want is: ifp = interface->altsetting + interface->num_altsetting; + memset(ifp, 0, sizeof(*ifp)); interface->num_altsetting++; can you test that out with your failing case ?
It would be great to get feedback on this and if SpanKY's patch is needed as opposed the patch from upstream (the Trac works for a long time now) then I'll update the patch attached to the upstream ticket.