diff --git a/gnucash/gnome-utils/dialog-commodity.cpp b/gnucash/gnome-utils/dialog-commodity.cpp index 5be8fd61b3..29871a140a 100644 --- a/gnucash/gnome-utils/dialog-commodity.cpp +++ b/gnucash/gnome-utils/dialog-commodity.cpp @@ -1268,10 +1268,12 @@ gnc_ui_commodity_dialog_to_object(CommodityWindow * w) gnc_commodity_set_user_symbol(c, user_symbol); gnc_commodity_commit_edit(c); + g_free (name_space); return TRUE; } gnc_warning_dialog (GTK_WINDOW (w->dialog), "%s", _("You may not create a new national currency.")); + g_free (name_space); return FALSE; } @@ -1283,6 +1285,7 @@ gnc_ui_commodity_dialog_to_object(CommodityWindow * w) gnc_warning_dialog (GTK_WINDOW (w->dialog), _("%s is a reserved commodity type." " Please use something else."), GNC_COMMODITY_NS_TEMPLATE); + g_free (name_space); return FALSE; } diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c index 9d0d89aa7c..81476925d2 100644 --- a/gnucash/gnome/dialog-price-editor.c +++ b/gnucash/gnome/dialog-price-editor.c @@ -267,12 +267,18 @@ gui_to_price (PriceEditDialog *pedit_dialog) commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), name_space, fullname); if (!commodity) + { + g_free (name_space); return _("You must select a Security."); + } currency = gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit)); if (!currency) + { + g_free (name_space); return _("You must select a Currency."); + } date = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit)); @@ -286,7 +292,10 @@ gui_to_price (PriceEditDialog *pedit_dialog) gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), 0); if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), NULL)) + { + g_free (name_space); return _("You must enter a valid amount."); + } value = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit)); diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c index cfe5949a07..39c356c1a2 100644 --- a/gnucash/import-export/qif-imp/assistant-qif-import.c +++ b/gnucash/import-export/qif-imp/assistant-qif-import.c @@ -2851,13 +2851,11 @@ gnc_ui_qif_import_commodity_notebook_update_combos (QIFImportWindow * wind, gboo for (pageptr = wind->commodity_notebook_pages; pageptr; pageptr = pageptr->next) { - const gchar *ns; - notebook_page = pageptr->data; comm_nb_page = g_object_get_data (G_OBJECT(notebook_page), "page_struct"); /* Get any entered namespace. */ - ns = gnc_ui_namespace_picker_ns (comm_nb_page->namespace_combo); + gchar *ns = gnc_ui_namespace_picker_ns (comm_nb_page->namespace_combo); /* Update the namespaces available to select. */ if (!ns || !ns[0]) @@ -2873,6 +2871,7 @@ gnc_ui_qif_import_commodity_notebook_update_combos (QIFImportWindow * wind, gboo } else gnc_ui_update_namespace_picker (comm_nb_page->namespace_combo, ns, DIAG_COMM_ALL); + g_free (ns); } }