Skip to content
Permalink
Browse files

hidapi: Zero out new hid_device_info structs

  • Loading branch information
aeikum committed Jul 23, 2019
1 parent bf9bf60 commit 0e9560aea22818884921e5e5064953257bfe7fa7
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/hidapi/linux/hid.c
  2. +1 −1 src/hidapi/mac/hid.c
@@ -547,7 +547,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
struct hid_device_info *tmp;

/* VID/PID match. Create the record. */
tmp = (struct hid_device_info *)malloc(sizeof(struct hid_device_info));
tmp = (struct hid_device_info *)calloc(1, sizeof(struct hid_device_info));
if (cur_dev) {
cur_dev->next = tmp;
}
@@ -472,7 +472,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
size_t len;

/* VID/PID match. Create the record. */
tmp = (struct hid_device_info *)malloc(sizeof(struct hid_device_info));
tmp = (struct hid_device_info *)calloc(1, sizeof(struct hid_device_info));
if (cur_dev) {
cur_dev->next = tmp;
}

0 comments on commit 0e9560a

Please sign in to comment.