aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-07-30 16:56:54 +0200
committerHans de Goede <hdegoede@redhat.com>2013-07-30 17:21:08 +0200
commit9afce4282ecbb32e0cef9282d7f97f2353d7eca1 (patch)
tree9bad1964e6fd80cbe0ad6362e1bf99173c1ea311
parent6ac8cd3ef3400ae2f061c194d54c0020ccb01607 (diff)
downloadandroid_external_libusbx-9afce4282ecbb32e0cef9282d7f97f2353d7eca1.tar.gz
android_external_libusbx-9afce4282ecbb32e0cef9282d7f97f2353d7eca1.tar.bz2
android_external_libusbx-9afce4282ecbb32e0cef9282d7f97f2353d7eca1.zip
linux_netlink: close netlink socket on init error
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libusb/os/linux_netlink.c2
-rw-r--r--libusb/version_nano.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libusb/os/linux_netlink.c b/libusb/os/linux_netlink.c
index 2a0268a..913618c 100644
--- a/libusb/os/linux_netlink.c
+++ b/libusb/os/linux_netlink.c
@@ -90,6 +90,7 @@ int linux_netlink_start_event_monitor(void)
ret = bind(linux_netlink_socket, (struct sockaddr *) &snl, sizeof(snl));
if (0 != ret) {
+ close(linux_netlink_socket);
return LIBUSB_ERROR_OTHER;
}
@@ -98,6 +99,7 @@ int linux_netlink_start_event_monitor(void)
ret = pthread_create(&libusb_linux_event_thread, NULL, linux_netlink_event_thread_main, NULL);
if (0 != ret) {
+ close(linux_netlink_socket);
return LIBUSB_ERROR_OTHER;
}
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index a684aef..f875265 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10783
+#define LIBUSB_NANO 10784