libusb_hid: Fix a potential memory leak

This commit is contained in:
Lioncash 2015-04-15 03:22:27 -04:00
parent eeb28dc4fb
commit fff8ef3db7

View File

@ -188,6 +188,7 @@ static int add_adapter(void *data, struct libusb_device *dev)
if (!adapter || !hid)
{
free(adapter);
fprintf(stderr, "Allocation of adapter failed.\n");
return -1;
}