Don't g_strdup char* returned by scm_to_locale_string

Previous code was returning a duplicated string and released the
original one. It's no better than returning the original returned
char* instead.
pull/1171/head
Christopher Lam 5 years ago
parent 19a91f041e
commit 171ce9413b

@ -243,16 +243,11 @@ time64 time64CanonicalDayTime(time64 t);
{
SCM key_scm = SCM_CAR (path_scm);
char *key;
gchar* gkey;
if (!scm_is_string (key_scm))
break;
key = scm_to_locale_string (key_scm);
gkey = g_strdup (key);
free (key);
path = g_list_prepend (path, gkey);
path = g_list_prepend (path, key);
path_scm = SCM_CDR (path_scm);
}
@ -462,13 +457,10 @@ void qof_book_set_string_option(QofBook* book, const char* opt_name, const char*
{
SCM key_scm = SCM_CAR (path_scm);
char *key;
gchar* gkey;
if (!scm_is_string (key_scm))
break;
key = scm_to_locale_string (key_scm);
gkey = g_strdup (key);
free (key);
path = g_list_prepend (path, gkey);
path = g_list_prepend (path, key);
path_scm = SCM_CDR (path_scm);
}
$1 = g_list_reverse (path);

Loading…
Cancel
Save