summaryrefslogtreecommitdiff
path: root/libusb/os/darwin_usb.c
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2012-06-28 22:49:47 +0100
committerPete Batard <pete@akeo.ie>2012-07-02 18:29:27 +0100
commit63f569be66a40a720bb797a87c3589f3e4de925a (patch)
treede87a88aeaef653a724a1843c566d4b2333ca607 /libusb/os/darwin_usb.c
parent0e0cbb6c27efa5a2ae58c30267a4be9486c766cc (diff)
downloadlibusb-63f569be66a40a720bb797a87c3589f3e4de925a.tar.gz
Misc: Fix more Clang warnings in core and darwin
* http://sourceforge.net/mailarchive/message.php?msg_id=29418038 * core.c:700:4: warning: Function call argument is an uninitialized value * darwin_usb.c:1713:11: warning: Access to field 'cfSource' results in a dereference of a null pointer (loaded from variable 'hpriv') * sync.c/dpfp.c/dpfp_threaded.c: warning: Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type
Diffstat (limited to 'libusb/os/darwin_usb.c')
-rw-r--r--libusb/os/darwin_usb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index ac67b35..63c2bae 100644
--- a/libusb/os/darwin_usb.c
+++ b/libusb/os/darwin_usb.c
@@ -1698,6 +1698,8 @@ static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL
if (hpriv->fds[0] == pollfd->fd)
break;
}
+ if (!hpriv)
+ continue;
if (!(pollfd->revents & POLLERR)) {
ret = read (hpriv->fds[0], &message, sizeof (message));