From 3f855f07f5d2e9a08a586436719358c40a46f29d Mon Sep 17 00:00:00 2001 From: TingPing Date: Sun, 28 Dec 2014 06:08:20 -0500 Subject: Use glib for allocations in all plugins Continuation of 83032b1aa --- plugins/sysinfo/pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/sysinfo/pci.c') 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 #include #include +#include + #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); -- cgit 1.4.1