[dialog-options] Plug memory leak

37a403144 had leaks.
This commit is contained in:
Christopher Lam 2021-03-15 22:03:15 +08:00
parent 7f1335e6a2
commit b51d227aff

View File

@ -398,10 +398,14 @@ gnc_option_set_ui_value_internal (GNCOption *option, gboolean use_default)
{
bad_value = option_def->set_value (option, use_default, widget, value);
if (bad_value)
PERR("option '%s' bad value '%s'\n",
gnc_option_name (option),
scm_to_locale_string (scm_object_to_string
(value, scm_c_eval_string ("write"))));
{
gchar *name = gnc_option_name (option);
gchar *val = scm_to_locale_string (scm_object_to_string
(value, scm_c_eval_string ("write")));
PERR ("option '%s' bad value '%s'\n", name, val);
g_free (name);
g_free (val);
}
}
else
PERR("Unknown type. Ignoring.\n");