Fix dereference after free. CID 10543.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39909 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b950cc6532
commit
13486cf531
@ -737,8 +737,9 @@ usb_disk_device_added(usb_device newDevice, void **cookie)
|
||||
device->notify = create_sem(0, "usb_disk callback notify");
|
||||
if (device->notify < B_OK) {
|
||||
mutex_destroy(&device->lock);
|
||||
status_t result = device->notify;
|
||||
free(device);
|
||||
return device->notify;
|
||||
return result;
|
||||
}
|
||||
|
||||
device->lun_count = usb_disk_get_max_lun(device) + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user