From 1f4d88b9156037b522960d90d8d0a80d348ec508 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Mon, 18 May 2020 13:25:51 -0400 Subject: [PATCH] configuration: fix memleak when reloading --- lib/wp/configuration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/wp/configuration.c b/lib/wp/configuration.c index 0fb5fdf3..4b046349 100644 --- a/lib/wp/configuration.c +++ b/lib/wp/configuration.c @@ -280,7 +280,6 @@ wp_configuration_reload (WpConfiguration *self, const char *extension) GError* error = NULL; const gchar *file_name = NULL; g_autofree gchar *ext = NULL; - g_autofree gchar *location = NULL; g_return_if_fail (WP_IS_CONFIGURATION (self)); @@ -312,7 +311,7 @@ wp_configuration_reload (WpConfiguration *self, const char *extension) while ((file_name = g_dir_read_name (conf_dir))) { /* Only parse files that have the proper extension */ if (g_str_has_suffix (file_name, ext)) { - location = g_build_filename (path, file_name, NULL); + g_autofree gchar * location = g_build_filename (path, file_name, NULL); wp_debug_object (self, "loading config file: %s", location);