diff options
author | Elliott Hughes <enh@google.com> | 2015-04-21 19:39:52 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-04-21 19:43:22 -0700 |
commit | dc3b459ff9f0ff71d404ba7198083e532a0dd894 (patch) | |
tree | 3e64efa2fefb22f72fbeb303a672353fb219de16 /adb/usb_osx.cpp | |
parent | 9a0cea92c8b74114b70ac3339b2b611633f6a31a (diff) | |
download | system_core-dc3b459ff9f0ff71d404ba7198083e532a0dd894.zip system_core-dc3b459ff9f0ff71d404ba7198083e532a0dd894.tar.gz system_core-dc3b459ff9f0ff71d404ba7198083e532a0dd894.tar.bz2 |
Add missing null checks after allocations.
Bug: http://b/20317729
Change-Id: I62bb761d48ee59a1f4ddd0cdd0632432305ca2ca
Diffstat (limited to 'adb/usb_osx.cpp')
-rw-r--r-- | adb/usb_osx.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/adb/usb_osx.cpp b/adb/usb_osx.cpp index 303ae45..a795ce3 100644 --- a/adb/usb_osx.cpp +++ b/adb/usb_osx.cpp @@ -336,6 +336,7 @@ CheckInterface(IOUSBInterfaceInterface **interface, UInt16 vendor, UInt16 produc goto err_bad_adb_interface; handle = reinterpret_cast<usb_handle*>(calloc(1, sizeof(usb_handle))); + if (handle == nullptr) goto err_bad_adb_interface; //* Iterate over the endpoints for this interface and find the first //* bulk in/out pipes available. These will be our read/write pipes. |