summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pci.c2
-rw-r--r--usb.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/pci.c b/pci.c
index 1609fe7..68c07af 100644
--- a/pci.c
+++ b/pci.c
@@ -98,6 +98,8 @@ extern struct pciusb_entries pci_probe(void) {
}
}
+
+ /* shrink to real size */
r.entries = realloc(r.entries, sizeof(struct pciusb_entry) * r.nb);
pci_cleanup(pacc);
diff --git a/usb.c b/usb.c
index c7f6503..2d5b77f 100644
--- a/usb.c
+++ b/usb.c
@@ -135,6 +135,8 @@ extern struct pciusb_entries usb_probe(void) {
build_text(e, vendor_text, product_text);
fclose(f);
+
+ /* shrink to real size */
r.entries = realloc(r.entries, sizeof(struct pciusb_entry) * r.nb);
pciusb_find_modules(&r, "usbtable", DO_NOT_LOAD, 0);