From afea6fd68ba81ce61db819788d79be774f9d96d0 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 23 Jul 2021 22:17:03 +0800 Subject: [PATCH] [gnc-report.c] free default_font_family if default_font_family is ".AppleSystemUIFont", it is not freed prior to returning "Arial". also default_font_family is given a g_strdup'd string therefore will never be NULL. --- gnucash/report/gnc-report.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnucash/report/gnc-report.c b/gnucash/report/gnc-report.c index 14b4dafb61..9701338676 100644 --- a/gnucash/report/gnc-report.c +++ b/gnucash/report/gnc-report.c @@ -336,9 +336,11 @@ gnc_get_default_report_font_family(void) pango_font_description_free (font_desc); - if (default_font_family == NULL || - g_str_has_prefix (default_font_family, ".AppleSystemUIFont")) - return g_strdup("Arial"); + if (g_str_has_prefix (default_font_family, ".AppleSystemUIFont")) + { + g_free (default_font_family); + return g_strdup ("Arial"); + } else return default_font_family; }