device_interfaces: Fix memory leak on success.
The module list was closed properly at the end of the function body (failure case) but not inside the loop on the success case. CID 605738.
This commit is contained in:
parent
d73993ff20
commit
14fcbb52cd
@ -463,8 +463,10 @@ get_device_interface(const char* name, bool create)
|
||||
status_t status = module->init_device(name, &device);
|
||||
if (status == B_OK) {
|
||||
interface = allocate_device_interface(device, module);
|
||||
if (interface != NULL)
|
||||
if (interface != NULL) {
|
||||
close_module_list(cookie);
|
||||
return interface;
|
||||
}
|
||||
|
||||
module->uninit_device(device);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user