am ab528077: am 37d894a4: am 660a514e: am 60097a9c: Merge "Structure device not freed in error case"

* commit 'ab5280776f40c473228d3e920771a41289ed7fee':
  Structure device not freed in error case
This commit is contained in:
Jeff Sharkey
2014-02-18 17:26:17 +00:00
committed by Android Git Automerger

View File

@@ -163,8 +163,10 @@ static jobject android_server_UsbHostManager_openDevice(JNIEnv *env, jobject thi
return NULL;
int fd = usb_device_get_fd(device);
if (fd < 0)
if (fd < 0) {
usb_device_close(device);
return NULL;
}
int newFD = dup(fd);
usb_device_close(device);