Fix small memory leak - unfreed string.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16066 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2007-05-08 21:03:48 +00:00
parent 0a179cf181
commit d0f4e853c4
2 changed files with 5 additions and 3 deletions

View File

@ -908,8 +908,8 @@ gnc_gconf_schemas_found (void)
key = gnc_gconf_make_schema_key(GCONF_GENERAL_REGISTER, "use_theme_colors"); key = gnc_gconf_make_schema_key(GCONF_GENERAL_REGISTER, "use_theme_colors");
schema = gconf_client_get_schema(our_client, key, &err); schema = gconf_client_get_schema(our_client, key, &err);
g_free(key);
if (schema == NULL) { if (schema == NULL) {
g_free(key);
return FALSE; return FALSE;
} }
gconf_schema_free(schema); gconf_schema_free(schema);

View File

@ -397,7 +397,7 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), NULL); gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), NULL);
gtk_list_store_clear(summary->datamodel); gtk_list_store_clear(summary->datamodel);
for (current = g_list_first(currency_list); current; current = g_list_next(current)) { 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; currency_accum = current->data;
@ -420,13 +420,15 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
gnc_commodity_print_info(currency_accum->currency, TRUE)); gnc_commodity_print_info(currency_accum->currency, TRUE));
gtk_list_store_append(summary->datamodel, &iter); 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, 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, _("Assets:"),
COLUMN_ASSETS_VALUE, asset_amount_string, COLUMN_ASSETS_VALUE, asset_amount_string,
COLUMN_PROFITS, _("Profits:"), COLUMN_PROFITS, _("Profits:"),
COLUMN_PROFITS_VALUE, profit_amount_string, COLUMN_PROFITS_VALUE, profit_amount_string,
-1); -1);
g_free(total_mode_label);
} }
gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo), gtk_combo_box_set_model(GTK_COMBO_BOX(summary->totals_combo),
GTK_TREE_MODEL(summary->datamodel)); GTK_TREE_MODEL(summary->datamodel));