summaryrefslogtreecommitdiff
path: root/libusb/os/threads_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'libusb/os/threads_windows.c')
-rw-r--r--libusb/os/threads_windows.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libusb/os/threads_windows.c b/libusb/os/threads_windows.c
index c4fa489..bb5c4c8 100644
--- a/libusb/os/threads_windows.c
+++ b/libusb/os/threads_windows.c
@@ -142,7 +142,7 @@ static int __inline usbi_cond_intwait(usbi_cond_t *cond,
}
}
if(!found) {
- pos = malloc(sizeof(struct usbi_cond_perthread));
+ pos = (struct usbi_cond_perthread*) calloc(1, sizeof(struct usbi_cond_perthread));
if(!pos) return ((errno=ENOMEM)); // This errno is not POSIX-allowed.
pos->tid = tid;
pos->event = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset.