Partitioning system: avoid leakage of resource
The storage returned from GetSession() was leaked CID 10827
This commit is contained in:
parent
342169dfe2
commit
f6bd30f2af
@ -54,10 +54,14 @@ identify_partition(int fd, partition_data *partition, void **cookie)
|
||||
if (disc != NULL && disc->InitCheck() == B_OK) {
|
||||
// If we have only a single session then we can let the file system
|
||||
// drivers play directly with the device.
|
||||
if (disc->GetSession(1) != NULL)
|
||||
Session *session = disc->GetSession(1);
|
||||
if (session != NULL) {
|
||||
result = 0.9f;
|
||||
delete session;
|
||||
}
|
||||
else
|
||||
result = 0.1f;
|
||||
|
||||
*cookie = static_cast<void*>(disc);
|
||||
} else
|
||||
delete disc;
|
||||
|
Loading…
Reference in New Issue
Block a user