summary refs log tree commit diff stats
path: root/plugins/sysinfo/pci.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-12-28 06:08:20 -0500
committerTingPing <tingping@tingping.se>2014-12-28 06:47:07 -0500
commit3f855f07f5d2e9a08a586436719358c40a46f29d (patch)
tree12ffd1b49265e33c10149632a4cd17afb7fe994a /plugins/sysinfo/pci.c
parent83032b1aa3c3e5910c5cfd3e0ea1d25827f56475 (diff)
Use glib for allocations in all plugins
Continuation of 83032b1aa
Diffstat (limited to 'plugins/sysinfo/pci.c')
-rw-r--r--plugins/sysinfo/pci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/sysinfo/pci.c b/plugins/sysinfo/pci.c
index 9946c446..d0f8d811 100644
--- a/plugins/sysinfo/pci.c
+++ b/plugins/sysinfo/pci.c
@@ -25,6 +25,8 @@
 #include <ctype.h>
 #include <unistd.h>
 #include <pci/pci.h>
+#include <glib.h>
+
 #include "xsys.h"
 
 static struct pci_filter filter;       /* Device filter */
@@ -47,8 +49,7 @@ static struct device *scan_device(struct pci_dev *p)
 
   	if (!pci_filter_match(&filter, p))
     		return NULL;
-  	d = malloc(sizeof(struct device));
-  	bzero(d, sizeof(*d));
+  	d = g_new0 (struct device, 1);
   	d->dev = p;
   	if (!pci_read_block(p, 0, d->config, how_much))
     		exit(1);