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/match.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/sysinfo/match.c') diff --git a/plugins/sysinfo/match.c b/plugins/sysinfo/match.c index ae850b5b..5f49ae41 100644 --- a/plugins/sysinfo/match.c +++ b/plugins/sysinfo/match.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "xsys.h" float percentage(unsigned long long *free, unsigned long long *total) @@ -37,13 +38,13 @@ char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned lo double free_space, total_space; free_space = *free_k; total_space = *total_k; - result = malloc(bsize * sizeof(char)); + result = g_new(char, bsize); if (total_space == 0) { snprintf(result, bsize, "%s: none", desc); return result; } - quantity = quantities; + quantity = quantities; while (total_space > 1023 && *(quantity + 1)) { quantity++; -- cgit 1.4.1