diff options
author | rbuj <[email protected]> | 2020-07-15 08:04:40 +0200 |
---|---|---|
committer | rbuj <[email protected]> | 2020-07-24 10:48:56 +0200 |
commit | 44852cc8e76efd31077b289f0a4848df151ea330 (patch) | |
tree | d33c45637d293b2969d73ba37addb9a9c9a42905 /multiload | |
parent | 22c4c6b6b0ef5c6fb54b3fc5f405f82b379cb32f (diff) | |
download | mate-applets-44852cc8e76efd31077b289f0a4848df151ea330.tar.bz2 mate-applets-44852cc8e76efd31077b289f0a4848df151ea330.tar.xz |
multiload: Fix memory leak
Diffstat (limited to 'multiload')
-rw-r--r-- | multiload/netspeed.c | 10 |
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) |