From 6cb6d14327959be27f72df787c7f014242b66561 Mon Sep 17 00:00:00 2001 From: Antenore Gatta Date: Thu, 18 Jun 2020 15:19:21 +0200 Subject: Using g_autofree when possible Signed-off-by: Antenore Gatta --- src/remmina_log.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/remmina_log.c') diff --git a/src/remmina_log.c b/src/remmina_log.c index 4dc6b659f..6da990bf3 100644 --- a/src/remmina_log.c +++ b/src/remmina_log.c @@ -201,15 +201,17 @@ void _remmina_debug(const gchar *fun, const gchar *fmt, ...) va_start(args, fmt); text = g_strdup_vprintf(fmt, args); va_end(args); + g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL); - g_debug ("%s", g_strdup(buf)); + g_debug ("%s", buf); - buf = g_strconcat (buf, "\n", NULL); + /* freed in remmina_log_print_real */ + gchar *bufn = g_strconcat(buf, "\n", NULL); if (!log_window) return; - IDLE_ADD(remmina_log_print_real, g_strdup(buf)); + IDLE_ADD(remmina_log_print_real, bufn); } void remmina_log_printf(const gchar *fmt, ...) -- cgit v1.2.3