Fix use after free in error case. CID 10545.
This commit is contained in:
parent
85819ae108
commit
7bdc07318d
@ -224,8 +224,9 @@ usb_printer_device_added(usb_device newDevice, void **cookie)
|
||||
device->notify = create_sem(0, "usb_printer callback notify");
|
||||
if (device->notify < B_OK) {
|
||||
mutex_destroy(&device->lock);
|
||||
status_t result = device->notify;
|
||||
free(device);
|
||||
return device->notify;
|
||||
return result;
|
||||
}
|
||||
|
||||
mutex_lock(&gDeviceListLock);
|
||||
|
Loading…
Reference in New Issue
Block a user