summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-06-25 14:42:23 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-06-25 14:42:23 +0000
commit5d36c9abed2306e48e6efdd0ebdca8d45e0f780e (patch)
treefd5cfecbe1ba4cbfe09f9e5b3fa03082381d1b24
parentc2aae37ae44a0058867d384791f3d0af85f7df1c (diff)
downloadldetect-5d36c9abed2306e48e6efdd0ebdca8d45e0f780e.tar
ldetect-5d36c9abed2306e48e6efdd0ebdca8d45e0f780e.tar.gz
ldetect-5d36c9abed2306e48e6efdd0ebdca8d45e0f780e.tar.bz2
ldetect-5d36c9abed2306e48e6efdd0ebdca8d45e0f780e.tar.xz
ldetect-5d36c9abed2306e48e6efdd0ebdca8d45e0f780e.zip
Do not lose pointer when realloc decides to move it
-rw-r--r--pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pci.c b/pci.c
index 6ed016b..dc18903 100644
--- a/pci.c
+++ b/pci.c
@@ -97,7 +97,8 @@ extern struct pciusb_entries pci_probe(void) {
close(devf);
}
- realloc(r.entries, sizeof(struct pciusb_entry) * r.nb);
+ r.entries = realloc(r.entries, sizeof(struct pciusb_entry) * r.nb);
+
pci_cleanup(pacc);
if (pciusb_find_modules(&r, "pcitable", DO_NOT_LOAD, 1))