summaryrefslogtreecommitdiff
path: root/multiload
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-15 08:04:40 +0200
committerrbuj <[email protected]>2020-07-24 10:48:56 +0200
commit44852cc8e76efd31077b289f0a4848df151ea330 (patch)
treed33c45637d293b2969d73ba37addb9a9c9a42905 /multiload
parent22c4c6b6b0ef5c6fb54b3fc5f405f82b379cb32f (diff)
downloadmate-applets-44852cc8e76efd31077b289f0a4848df151ea330.tar.bz2
mate-applets-44852cc8e76efd31077b289f0a4848df151ea330.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)