summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/procman.cpp4
-rw-r--r--src/util.cpp10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/procman.cpp b/src/procman.cpp
index c21e61f..180b0d4 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -189,7 +189,7 @@ static void
color_changed_cb (GSettings *settings, const gchar *key, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- const gchar *color = g_settings_get_string (settings, key);
+ gchar *color = g_settings_get_string (settings, key);
if (g_str_has_prefix (key, "cpu-color")) {
for (int i = 0; i < procdata->config.num_cpus; i++) {
@@ -220,6 +220,7 @@ color_changed_cb (GSettings *settings, const gchar *key, gpointer data)
else {
g_assert_not_reached();
}
+ g_free (color);
}
@@ -450,6 +451,7 @@ procman_get_tree_state (GSettings *settings, GtkWidget *tree, const gchar *child
proctable_set_columns_order(GTK_TREE_VIEW(tree), order);
+ g_variant_unref(value);
g_slist_free(order);
}
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;
}
}