From 44852cc8e76efd31077b289f0a4848df151ea330 Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 15 Jul 2020 08:04:40 +0200 Subject: multiload: Fix memory leak --- multiload/netspeed.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'multiload') 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) -- cgit v1.2.1