From 3a51ab881647e60a6f8af76a8b111ae2bfe0e3cc Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sat, 23 Jun 2018 10:22:23 -0700 Subject: Free memory allocated with g_malloc() using g_free() --- modules/devices/battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/devices/battery.c b/modules/devices/battery.c index cbcebb12..9994cfd8 100644 --- a/modules/devices/battery.c +++ b/modules/devices/battery.c @@ -229,11 +229,11 @@ read_contents(const gchar *base, const gchar *key) return NULL; if (!g_file_get_contents(path, &value, NULL, NULL)) { - free(path); + g_free(path); return NULL; } - free(path); + g_free(path); return g_strchomp(value); } -- cgit v1.2.3