summaryrefslogtreecommitdiffstats
path: root/daemon/usb-linux.c
diff options
context:
space:
mode:
authorGravatar Hector Martin2010-06-17 18:24:17 +0200
committerGravatar Hector Martin2010-06-17 18:24:17 +0200
commit3ea39bc9c977ddbbcb168f79505e0856942a259d (patch)
tree8d55243590b973c9028b0c7970c77a16558ab1dd /daemon/usb-linux.c
parent7a4ab4e6a6225f06d01405187c19cfa3cb7bd600 (diff)
downloadusbmuxd-3ea39bc9c977ddbbcb168f79505e0856942a259d.tar.gz
usbmuxd-3ea39bc9c977ddbbcb168f79505e0856942a259d.tar.bz2
Fix segfault when device initialization fails
Diffstat (limited to 'daemon/usb-linux.c')
-rw-r--r--daemon/usb-linux.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/daemon/usb-linux.c b/daemon/usb-linux.c
index c9420c8..0860b46 100644
--- a/daemon/usb-linux.c
+++ b/daemon/usb-linux.c
@@ -322,6 +322,7 @@ int usb_discover(void)
struct usb_device *usbdev;
usbdev = malloc(sizeof(struct usb_device));
+ memset(usbdev, 0, sizeof(*usbdev));
for(j=0; j<config->bNumInterfaces; j++) {
const struct libusb_interface_descriptor *intf = &config->interface[j].altsetting[0];