Correct memory handling of scm_to_locale_string per guile manual

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20757 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
J. Alex Aycinena
2011-06-13 03:49:50 +00:00
parent 3e258a2b39
commit 61208eb617

View File

@@ -36,7 +36,15 @@ gfec_catcher(void *data, SCM tag, SCM throw_args)
{
result = scm_call_2(func, tag, throw_args);
if (scm_is_string(result))
msg = scm_to_locale_string(result);
{
char * str;
scm_dynwind_begin (0);
str = scm_to_locale_string (result);
msg = g_strdup (str);
scm_dynwind_free (str);
scm_dynwind_end ();
}
}
if (msg == NULL)