hidapi: Zero out new hid_device_info structs
This commit is contained in:
parent
7a84f02172
commit
b71dec57ab
2 changed files with 2 additions and 2 deletions
|
@ -547,7 +547,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
||||||
struct hid_device_info *tmp;
|
struct hid_device_info *tmp;
|
||||||
|
|
||||||
/* VID/PID match. Create the record. */
|
/* 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) {
|
if (cur_dev) {
|
||||||
cur_dev->next = tmp;
|
cur_dev->next = tmp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -472,7 +472,7 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* VID/PID match. Create the record. */
|
/* 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) {
|
if (cur_dev) {
|
||||||
cur_dev->next = tmp;
|
cur_dev->next = tmp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue