summary refs log tree commit diff stats
path: root/plugins/sysinfo/parse.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/parse.c
parent83032b1aa3c3e5910c5cfd3e0ea1d25827f56475 (diff)
Use glib for allocations in all plugins
Continuation of 83032b1aa
Diffstat (limited to 'plugins/sysinfo/parse.c')
-rw-r--r--plugins/sysinfo/parse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/sysinfo/parse.c b/plugins/sysinfo/parse.c
index 6c86c645..caba8a7d 100644
--- a/plugins/sysinfo/parse.c
+++ b/plugins/sysinfo/parse.c
@@ -29,6 +29,7 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <pci/header.h>
+#include <glib.h>
 
 #include "pci.h"
 #include "match.h"
@@ -317,13 +318,13 @@ int xs_parse_df(const char *mount_point, char *result)
 			char *tmp_buf = pretty_freespace(pos, &free_k, &total_k);
 			strcat(tmp_buf, " | ");
 			strcat(result, tmp_buf);
-			free(tmp_buf);
+			g_free(tmp_buf);
 		}
 		else if(strncmp(mount_point, pos, strlen(mount_point)) == 0)
 		{
 			char *tmp_buf = pretty_freespace(mount_point, &free_k, &total_k);
 			strncpy(result, tmp_buf, bsize);
-			free(tmp_buf);
+			g_free(tmp_buf);
 			break;
 		}
 		else snprintf(result, bsize, "Mount point %s not found!", mount_point);
@@ -336,7 +337,7 @@ int xs_parse_df(const char *mount_point, char *result)
 	{
 		char *tmp_buf = pretty_freespace("Total", &free_k, &total_k);
 		strncpy(result, tmp_buf, bsize);
-		free(tmp_buf);
+		g_free(tmp_buf);
 	}
 	pclose(pipe);
 	return 0;