Correct memory leak found with Valgrind.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20718 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
J. Alex Aycinena 2011-05-28 23:32:33 +00:00
parent 6b0d693f1e
commit 9f6080b566

View File

@ -140,15 +140,18 @@ GncGUID
gnc_scm2guid(SCM guid_scm) gnc_scm2guid(SCM guid_scm)
{ {
GncGUID guid; GncGUID guid;
const gchar * str; gchar * str;
if (!scm_is_string(guid_scm) if (!scm_is_string(guid_scm)
|| (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm))) || (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm)))
{ {
return *guid_null(); return *guid_null();
} }
scm_dynwind_begin (0);
str = scm_to_locale_string (guid_scm); str = scm_to_locale_string (guid_scm);
string_to_guid(str, &guid); string_to_guid(str, &guid);
scm_dynwind_free (str);
scm_dynwind_end ();
return guid; return guid;
} }