From fbc183a544d51aef9f4c343ae4c6a93a1896c508 Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Sun, 5 Nov 2023 23:58:01 +0100 Subject: [PATCH] Always return an allocated gchar* Returning the literal string will cause the caller to free unallocated memory. --- libgnucash/core-utils/gnc-path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgnucash/core-utils/gnc-path.c b/libgnucash/core-utils/gnc-path.c index 99adef2799..b6404f5bbc 100644 --- a/libgnucash/core-utils/gnc-path.c +++ b/libgnucash/core-utils/gnc-path.c @@ -145,7 +145,7 @@ gchar *gnc_path_get_localedir() { g_free (prefix); g_free (locale_subdir); - return LOCALEDIR; + return g_strdup (LOCALEDIR); } else {