From e0f107f75eadd2a807044b4deee0c29efc3cce29 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 28 Jul 2025 11:27:54 +0200 Subject: [PATCH] Fix memory leak. Signed-off-by: Steffen Jaeckel --- src/command/cmd_funcs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 098d192f..7ebfa7d8 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8565,19 +8565,20 @@ cmd_omemo_trust_mode(ProfWin* window, const char* const command, gchar** args) { #ifdef HAVE_OMEMO + auto_gchar gchar* trust_mode = prefs_get_string(PREF_OMEMO_TRUST_MODE); if (!args[1]) { - cons_show("Current trust mode is %s", prefs_get_string(PREF_OMEMO_TRUST_MODE)); + cons_show("Current trust mode is %s", trust_mode); return TRUE; } if (g_strcmp0(args[1], "manual") == 0) { - cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]); + cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]); cons_show("You need to trust all OMEMO fingerprints manually"); } else if (g_strcmp0(args[1], "firstusage") == 0) { - cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]); + cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]); cons_show("The first seen OMEMO fingerprints will be trusted automatically - new keys must be trusted manually"); } else if (g_strcmp0(args[1], "blind") == 0) { - cons_show("Current trust mode is %s - setting to %s", prefs_get_string(PREF_OMEMO_TRUST_MODE), args[1]); + cons_show("Current trust mode is %s - setting to %s", trust_mode, args[1]); cons_show("ALL OMEMO fingerprints will be trusted automatically"); } else { cons_bad_cmd_usage(command);