version on usb.h doesn't include stdlib.h like libusb does, it fails to find prototypes for realloc function which leads to incorrect storage types used and memory corruption as a consequence.