Extra memory from usbd_attach()

Hello,

I’m working on a USB class driver. I have the usbd_attach() function allocate the memory for my device extension structure, as recommended in the USB DDK guide.

Question is: Who frees that memory when the device gets removed? Do I have to do it myself or does the corresponding usbd_detach() call do it? Since USB devices may be inserted and removed many times during the life of the driver process, I see great potential for memory leaks here, and the QNX documentation doesn’t state who’s responsible for the extra memory.

Best regards,
Albrecht