summary refs log tree commit diff stats
path: root/plugins/sysinfo/match.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/match.c
parent83032b1aa3c3e5910c5cfd3e0ea1d25827f56475 (diff)
Use glib for allocations in all plugins
Continuation of 83032b1aa
Diffstat (limited to 'plugins/sysinfo/match.c')
-rw-r--r--plugins/sysinfo/match.c5
1 files changed, 3 insertions, 2 deletions
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 <string.h>
 #include <ctype.h>
 #include <unistd.h>
+#include <glib.h>
 #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++;