pci: Fix memory leaks in uninorth (ppc)
The future cookie was leaked in three of four error scenarios. Backported from grackle. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38345 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -243,6 +243,7 @@ ppc_openfirmware_probe_uninorth(int deviceNode,
|
||||
|
||||
if (bytesRead < 0) {
|
||||
dprintf("ppc_openfirmware_probe_uninorth: Could not get ranges.\n");
|
||||
free(bridge);
|
||||
return B_ERROR;
|
||||
}
|
||||
bridge->range_count = bytesRead / sizeof(uninorth_range);
|
||||
@@ -269,11 +270,13 @@ ppc_openfirmware_probe_uninorth(int deviceNode,
|
||||
|
||||
if (ioRange == NULL) {
|
||||
dprintf("ppc_openfirmware_probe_uninorth: Can't find io range.\n");
|
||||
free(bridge);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
if (memoryRangeCount == 0) {
|
||||
dprintf("ppc_openfirmware_probe_uninorth: Can't find mem ranges.\n");
|
||||
free(bridge);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user