diff options
author | Peter Stuge <peter@stuge.se> | 2011-05-10 10:05:29 +0200 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2011-06-13 22:06:31 +0200 |
commit | 3ccd9bddec316ee4b867959fd7f616eb4d410997 (patch) | |
tree | b8d90ef88eef23074eb32035f5291ac312af19ea /libusb/core.c | |
parent | bb108cbe39802785d10fe025b74ca5ee19734151 (diff) | |
download | libusbx-3ccd9bddec316ee4b867959fd7f616eb4d410997.tar.gz |
Windows: enumeration overhaul
* uses multiple passes in a single call
* uses a hash table, in anticipation for hotplug
* adds a (dummy) HUB interface for harmonization
* adds calloc on device struct creation in core
(to detect and avoid unnecessary double initialization)
Diffstat (limited to 'libusb/core.c')
-rw-r--r-- | libusb/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libusb/core.c b/libusb/core.c index 6605c96..c40d9d5 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -508,7 +508,7 @@ struct libusb_device *usbi_alloc_device(struct libusb_context *ctx, unsigned long session_id) { size_t priv_size = usbi_backend->device_priv_size; - struct libusb_device *dev = malloc(sizeof(*dev) + priv_size); + struct libusb_device *dev = calloc(1, sizeof(*dev) + priv_size); int r; if (!dev) |