Clear the structure memory on exiting libx52

debian-packaging
nirenjan 2020-05-22 10:33:33 -07:00
parent cc8d6e9344
commit 0b6bc8f074
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ void libx52_exit(libx52_device *dev)
{
libusb_close(dev->hdl);
libusb_exit(dev->ctx);
/* Clear the memory to prevent reuse */
memset(dev, 0, sizeof(*dev));
free(dev);
}