Skip to content

Commit 5de6a08

Browse files
gnc_ui_namespace_picker_ns must be g_freed
1 parent 13e4485 commit 5de6a08

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

gnucash/gnome-utils/dialog-commodity.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,10 +1268,12 @@ gnc_ui_commodity_dialog_to_object(CommodityWindow * w)
12681268
gnc_commodity_set_user_symbol(c, user_symbol);
12691269

12701270
gnc_commodity_commit_edit(c);
1271+
g_free (name_space);
12711272
return TRUE;
12721273
}
12731274
gnc_warning_dialog (GTK_WINDOW (w->dialog), "%s",
12741275
_("You may not create a new national currency."));
1276+
g_free (name_space);
12751277
return FALSE;
12761278
}
12771279

@@ -1283,6 +1285,7 @@ gnc_ui_commodity_dialog_to_object(CommodityWindow * w)
12831285
gnc_warning_dialog (GTK_WINDOW (w->dialog),
12841286
_("%s is a reserved commodity type."
12851287
" Please use something else."), GNC_COMMODITY_NS_TEMPLATE);
1288+
g_free (name_space);
12861289
return FALSE;
12871290
}
12881291

gnucash/gnome/dialog-price-editor.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,18 @@ gui_to_price (PriceEditDialog *pedit_dialog)
267267

268268
commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), name_space, fullname);
269269
if (!commodity)
270+
{
271+
g_free (name_space);
270272
return _("You must select a Security.");
273+
}
271274

272275
currency = gnc_currency_edit_get_currency
273276
(GNC_CURRENCY_EDIT (pedit_dialog->currency_edit));
274277
if (!currency)
278+
{
279+
g_free (name_space);
275280
return _("You must select a Currency.");
281+
}
276282

277283
date = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
278284

@@ -286,7 +292,10 @@ gui_to_price (PriceEditDialog *pedit_dialog)
286292
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), 0);
287293

288294
if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), NULL))
295+
{
296+
g_free (name_space);
289297
return _("You must enter a valid amount.");
298+
}
290299

291300
value = gnc_amount_edit_get_amount
292301
(GNC_AMOUNT_EDIT (pedit_dialog->price_edit));

gnucash/import-export/qif-imp/assistant-qif-import.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,13 +2851,11 @@ gnc_ui_qif_import_commodity_notebook_update_combos (QIFImportWindow * wind, gboo
28512851

28522852
for (pageptr = wind->commodity_notebook_pages; pageptr; pageptr = pageptr->next)
28532853
{
2854-
const gchar *ns;
2855-
28562854
notebook_page = pageptr->data;
28572855
comm_nb_page = g_object_get_data (G_OBJECT(notebook_page), "page_struct");
28582856

28592857
/* Get any entered namespace. */
2860-
ns = gnc_ui_namespace_picker_ns (comm_nb_page->namespace_combo);
2858+
gchar *ns = gnc_ui_namespace_picker_ns (comm_nb_page->namespace_combo);
28612859

28622860
/* Update the namespaces available to select. */
28632861
if (!ns || !ns[0])
@@ -2873,6 +2871,7 @@ gnc_ui_qif_import_commodity_notebook_update_combos (QIFImportWindow * wind, gboo
28732871
}
28742872
else
28752873
gnc_ui_update_namespace_picker (comm_nb_page->namespace_combo, ns, DIAG_COMM_ALL);
2874+
g_free (ns);
28762875
}
28772876
}
28782877

0 commit comments

Comments
 (0)