summaryrefslogtreecommitdiff
path: root/multiload
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-15 08:04:40 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-07-24 10:47:52 +0200
commit7b4863d13487a770738a22afa8cf3c108bc04cf2 (patch)
tree0a2c7d5e3c417a90e1e4f7e0c051963a5c3ca045 /multiload
parent425fd302e154cb737075befe6c5b314696fa0490 (diff)
downloadmate-applets-7b4863d13487a770738a22afa8cf3c108bc04cf2.tar.bz2
mate-applets-7b4863d13487a770738a22afa8cf3c108bc04cf2.tar.xz
multiload: Fix memory leak
Diffstat (limited to 'multiload')
-rw-r--r--multiload/netspeed.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/multiload/netspeed.c b/multiload/netspeed.c
index 7d46ec7a..21747881 100644
--- a/multiload/netspeed.c
+++ b/multiload/netspeed.c
@@ -36,8 +36,14 @@ void netspeed_add(NetSpeed *ns, gulong tx)
static char*
format_rate_for_display(guint rate)
{
- char* bytes = g_format_size(rate);
- return g_strdup_printf(_("%s/s"), bytes);
+ char *bytes;
+ char *text;
+
+ bytes = g_format_size (rate);
+ text = g_strdup_printf (_("%s/s"), bytes);
+ g_free (bytes);
+
+ return text;
}
char* netspeed_get(NetSpeed *ns)