projects
/
platform
/
upstream
/
libpciaccess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42b879a
)
Free return value from scandir instead of leaking it.
author
Keith Packard
<keithp@keithp.com>
Fri, 18 Sep 2009 00:38:56 +0000
(17:38 -0700)
committer
Keith Packard
<keithp@keithp.com>
Fri, 18 Sep 2009 00:40:05 +0000
(17:40 -0700)
Scandir is defined to return pointers to malloc'd storage, so make
sure that memory is nicely freed.
Signed-off-by: Keith Packard <keithp@keithp.com>
src/linux_sysfs.c
patch
|
blob
|
history
diff --git
a/src/linux_sysfs.c
b/src/linux_sysfs.c
index
02fbd13
..
85095b3
100644
(file)
--- a/
src/linux_sysfs.c
+++ b/
src/linux_sysfs.c
@@
-213,6
+213,10
@@
populate_entries( struct pci_system * p )
}
}
+ for (i = 0; i < n; i++)
+ free(devices[i]);
+ free(devices);
+
if (err) {
free(p->devices);
p->devices = NULL;