diff options
author | Richard Hughes <richard@hughsie.com> | 2014-11-20 10:23:55 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-11-20 10:23:55 +0000 |
commit | a5e62b7d078520f79f7b5c9dfc3492091b60530f (patch) | |
tree | de54c9f5650c9c05a1f015c4403bf20e67046a04 /gusb/gusb-source.c | |
parent | 3b68de9634f47d9b4b837c3d9144cf03fd356465 (diff) | |
download | gusb-a5e62b7d078520f79f7b5c9dfc3492091b60530f.tar.gz |
Fix a crash where libusb_get_pollfds() is unavailable
Diffstat (limited to 'gusb/gusb-source.c')
-rw-r--r-- | gusb/gusb-source.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gusb/gusb-source.c b/gusb/gusb-source.c index 08325bc..4e06658 100644 --- a/gusb/gusb-source.c +++ b/gusb/gusb-source.c @@ -247,7 +247,7 @@ _g_usb_source_new (GMainContext *main_ctx, /* watch the fd's already created */ pollfds = libusb_get_pollfds (gusb_source->ctx); - for (i=0; pollfds[i] != NULL; i++) + for (i = 0; pollfds != NULL && pollfds[i] != NULL; i++) g_usb_source_pollfd_add (gusb_source, pollfds[i]->fd, pollfds[i]->events); |