From 292deb0a11347d0032a0b7c5b179c5c2eb1b000b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 28 May 2021 22:36:37 +0800 Subject: [PATCH] [binreloc.c] free strings subdir, prefix are not consistently freed. --- libgnucash/core-utils/binreloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libgnucash/core-utils/binreloc.c b/libgnucash/core-utils/binreloc.c index 6227be1e8a..557f9d20f0 100644 --- a/libgnucash/core-utils/binreloc.c +++ b/libgnucash/core-utils/binreloc.c @@ -438,11 +438,18 @@ find_component_directory (const gchar *default_dir, const gchar* compiled_dir) prefix = gnc_gbr_find_prefix (NULL); if (prefix == NULL) + { + g_free (subdir); return g_strdup (default_dir ? default_dir : compiled_dir); + } if (!g_getenv("GNC_UNINSTALLED")) { if (!g_strcmp0 (prefix, PREFIX)) + { + g_free (subdir); + g_free (prefix); return g_strdup (compiled_dir); + } if (g_strcmp0 (compiled_dir, subdir) == 0) {