lib/generic.c: Removed memory leak in pci_generic_bus_scan().
Reported by Gary Parnes <gary_parnes@terago.com>.
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-5
2003-12-26 Martin Mares <mj@ucw.cz>
+ * lib/generic.c: Removed memory leak in pci_generic_bus_scan().
+ Reported by Gary Parnes <gary_parnes@terago.com>.
+
* Replaced obsolete syntax of __attribute__((unused)) in the middle of
parameter declarations (which is no longer supported by GCC 3.1) by the
current syntax (attribute at the end). Thanks to pixel@mandrakesoft.com
pci_generic_scan_bus(struct pci_access *a, byte *busmap, int bus)
{
int dev, multi, ht;
- struct pci_dev *t = pci_alloc_dev(a);
+ struct pci_dev *t;
a->debug("Scanning bus %02x for devices...\n", bus);
if (busmap[bus])
return;
}
busmap[bus] = 1;
+ t = pci_alloc_dev(a);
t->bus = bus;
for(dev=0; dev<32; dev++)
{
}
}
}
+ pci_free_dev(t);
}
void