diff options
author | Davidlohr Bueso <dave@gnu.org> | 2012-07-11 13:53:00 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-07-13 15:59:57 +0100 |
commit | 1572419e943e80883da9341ca65703124938c3d8 (patch) | |
tree | 9afad9ffadf5954c97fee1bf7e8524457ff43b82 /libusb/io.c | |
parent | 7ec94a45ed8155e7a1d4d5d75575099b09c78834 (diff) | |
download | libusb-1572419e943e80883da9341ca65703124938c3d8.tar.gz |
All: Replace malloc+memset with calloc
Diffstat (limited to 'libusb/io.c')
-rw-r--r-- | libusb/io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libusb/io.c b/libusb/io.c index d06d375..b8d445c 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -1232,11 +1232,10 @@ struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer( + sizeof(struct libusb_transfer) + (sizeof(struct libusb_iso_packet_descriptor) * iso_packets) + os_alloc_size; - struct usbi_transfer *itransfer = malloc(alloc_size); + struct usbi_transfer *itransfer = calloc(1, alloc_size); if (!itransfer) return NULL; - memset(itransfer, 0, alloc_size); itransfer->num_iso_packets = iso_packets; usbi_mutex_init(&itransfer->lock, NULL); return USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); |