summaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 28def73..a96f776 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -495,13 +495,19 @@ namespace procman
std::string format_network(guint64 rate, guint64 max_rate)
{
- return procman::format_size(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
+ char* bytes = procman::format_size(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
+ std::string formatted(bytes);
+ g_free(bytes);
+ return formatted;
}
std::string format_network_rate(guint64 rate, guint64 max_rate)
{
- return procman::format_rate(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
+ char* bytes = procman::format_size(rate, max_rate, ProcData::get_instance()->config.network_in_bits);
+ std::string formatted(bytes);
+ g_free(bytes);
+ return formatted;
}
}