From 6b92164ff211cc35457a8a21af8f00ade40bdc0c Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 6 Nov 2024 10:05:27 -0300 Subject: [PATCH] importer: Don't duplicate string unnecessarily --- src/gui/importer/gcal-importer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/importer/gcal-importer.c b/src/gui/importer/gcal-importer.c index 87229a41..7b0bbf10 100644 --- a/src/gui/importer/gcal-importer.c +++ b/src/gui/importer/gcal-importer.c @@ -84,7 +84,7 @@ read_file_in_thread (GTask *task, g_autoptr (GError) error = NULL; g_autofree gchar *contents = NULL; g_autofree gchar *path = NULL; - g_autofree gchar *encoding = NULL; + const gchar *encoding = NULL; ICalComponent *component; ICalErrorEnum ical_error; gsize length; @@ -122,7 +122,7 @@ read_file_in_thread (GTask *task, return; } - encoding = g_strdup (guess_file_encoding (contents, length)); + encoding = guess_file_encoding (contents, length); if (g_strcmp0 (encoding, "UTF-8") != 0) {