From 184669f517744ac7be6e420e5e1f359384f676d5 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 23 Feb 2023 09:47:37 -0800 Subject: [PATCH] Bug 798754 - Build fails with gcc 13 and glib > 2.76 GLib 2.76 introduced a no-discard warning on g_string_free if the second parameter is FALSE. This revealed a string leak and a correct usage that didn't use the return value. --- libgnucash/gnc-module/gnc-module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgnucash/gnc-module/gnc-module.c b/libgnucash/gnc-module/gnc-module.c index f6ffcdf7d0..bef6906785 100644 --- a/libgnucash/gnc-module/gnc-module.c +++ b/libgnucash/gnc-module/gnc-module.c @@ -108,7 +108,7 @@ gnc_module_system_search_dirs(void) if (!escchar) { list = g_list_append(list, token->str); - g_string_free(token, FALSE); + g_string_free(token, TRUE); token = g_string_new(NULL); } else @@ -126,8 +126,8 @@ gnc_module_system_search_dirs(void) } if (token->len) { - list = g_list_append(list, token->str); - g_string_free(token, FALSE); + char *token_str = g_string_free (token, FALSE); + list = g_list_append(list, token_str); } else {