Forgot to use nothrow for the allocation of the interface descriptor. Thanks
for pointing that out Stephan! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24845 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,8 +9,10 @@
|
|||||||
|
|
||||||
#include <USBKit.h>
|
#include <USBKit.h>
|
||||||
#include <usb_raw.h>
|
#include <usb_raw.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
#include <new>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
BUSBInterface::BUSBInterface(BUSBConfiguration *config, uint32 index, int rawFD)
|
BUSBInterface::BUSBInterface(BUSBConfiguration *config, uint32 index, int rawFD)
|
||||||
@@ -160,7 +162,8 @@ BUSBInterface::CountAlternates() const
|
|||||||
usb_interface_descriptor *
|
usb_interface_descriptor *
|
||||||
BUSBInterface::AlternateAt(uint32 alternateIndex)
|
BUSBInterface::AlternateAt(uint32 alternateIndex)
|
||||||
{
|
{
|
||||||
usb_interface_descriptor *descriptor = new usb_interface_descriptor;
|
usb_interface_descriptor *descriptor
|
||||||
|
= new(std::nothrow) usb_interface_descriptor;
|
||||||
if (descriptor == NULL)
|
if (descriptor == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user