From d0f4e853c41a73b5621f4f7fc66f51f1501b5b8e Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Tue, 8 May 2007 21:03:48 +0000 Subject: [PATCH] Fix small memory leak - unfreed string. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16066 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/core-utils/gnc-gconf-utils.c | 2 +- src/gnome-utils/window-main-summarybar.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core-utils/gnc-gconf-utils.c b/src/core-utils/gnc-gconf-utils.c index ac81b9de85..dba82df4e0 100644 --- a/src/core-utils/gnc-gconf-utils.c +++ b/src/core-utils/gnc-gconf-utils.c @@ -908,8 +908,8 @@ gnc_gconf_schemas_found (void) key = gnc_gconf_make_schema_key(GCONF_GENERAL_REGISTER, "use_theme_colors"); schema = gconf_client_get_schema(our_client, key, &err); + g_free(key); if (schema == NULL) { - g_free(key); return FALSE; } gconf_schema_free(schema); diff --git a/src/gnome-utils/window-main-summarybar.c b/src/gnome-utils/window-main-summarybar.c index f6c89c43b0..03468ab435 100644 --- a/src/gnome-utils/window-main-summarybar.c +++ b/src/gnome-utils/window-main-summarybar.c @@ -397,7 +397,7 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary) gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), NULL); gtk_list_store_clear(summary->datamodel); for (current = g_list_first(currency_list); current; current = g_list_next(current)) { - const char *mnemonic; + const char *mnemonic, *total_mode_label; currency_accum = current->data; @@ -420,13 +420,15 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary) gnc_commodity_print_info(currency_accum->currency, TRUE)); gtk_list_store_append(summary->datamodel, &iter); + total_mode_label = get_total_mode_label(mnemonic, currency_accum->total_mode); gtk_list_store_set(summary->datamodel, &iter, - COLUMN_MNEMONIC_TYPE, get_total_mode_label(mnemonic, currency_accum->total_mode), + COLUMN_MNEMONIC_TYPE, total_mode_label, COLUMN_ASSETS, _("Assets:"), COLUMN_ASSETS_VALUE, asset_amount_string, COLUMN_PROFITS, _("Profits:"), COLUMN_PROFITS_VALUE, profit_amount_string, -1); + g_free(total_mode_label); } gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), GTK_TREE_MODEL(summary->datamodel));