mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-08-19 01:15:04 -05:00
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.
This commit is contained in:
+2
-10
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user