summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-05 19:06:36 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-05 19:06:36 +0000
commit3944ab661769d37b2c352a5b748a54b821e3e671 (patch)
treef02c14e1d16d2c65fb4a4a5f71e58ad014935644
parentd4b800ce34c7060080ec40d97c88d17982961e39 (diff)
downloadldetect-3944ab661769d37b2c352a5b748a54b821e3e671.tar
ldetect-3944ab661769d37b2c352a5b748a54b821e3e671.tar.gz
ldetect-3944ab661769d37b2c352a5b748a54b821e3e671.tar.bz2
ldetect-3944ab661769d37b2c352a5b748a54b821e3e671.tar.xz
ldetect-3944ab661769d37b2c352a5b748a54b821e3e671.zip
(usb_probe) free last memleak by using new usbutils' names_exit()
(introduced in r258129 by pterjan on 2009-06-25: "Use usb.ids")
-rw-r--r--NEWS1
-rw-r--r--usb.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index da285c4..3df8cd2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
- plug some memleaks
- sync with names with usbutils-005
+ (thus fixing more memleaks)
Version 0.11.3 - 21 November 2011, Thierry Vignaud
diff --git a/usb.c b/usb.c
index 2d5b77f..60925d4 100644
--- a/usb.c
+++ b/usb.c
@@ -57,7 +57,7 @@ extern struct pciusb_entries usb_probe(void) {
free(err_msg);
}
r.entries = NULL;
- return r;
+ goto exit;
}
r.entries = malloc(sizeof(struct pciusb_entry) * MAX_DEVICES);
@@ -140,6 +140,9 @@ extern struct pciusb_entries usb_probe(void) {
r.entries = realloc(r.entries, sizeof(struct pciusb_entry) * r.nb);
pciusb_find_modules(&r, "usbtable", DO_NOT_LOAD, 0);
+
+exit:
+ names_exit();
return r;
}