[balsa/gtk4: 241/246] pref-manager: Allocate a copy of the uri




commit 5927d109732eb26c70ba1ffb76b8b3e5cf565136
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Oct 31 19:37:48 2020 -0400

    pref-manager: Allocate a copy of the uri

 src/pref-manager.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/pref-manager.c b/src/pref-manager.c
index 90a571610..6ffd96d32 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -1092,12 +1092,12 @@ create_action_after_move_menu(void)
 }
 
 static void
-help_button_finish(GObject      *source_object,
-                   GAsyncResult *result,
-                   gpointer      user_data)
+help_pbox_display_finish(GObject      *source_object,
+                         GAsyncResult *result,
+                         gpointer      user_data)
 {
     GtkWindow *parent = GTK_WINDOW(source_object);
-    const char *uri = user_data;
+    char *uri = user_data;
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
@@ -1106,6 +1106,8 @@ help_button_finish(GObject      *source_object,
                              uri, error->message);
         g_error_free(error);
     }
+
+    g_free(uri);
 }
 
 static void
@@ -1143,7 +1145,8 @@ balsa_help_pbox_display(void)
     uri = g_string_free(string, FALSE);
 
     root = gtk_widget_get_root(GTK_WIDGET(pui->view));
-    gtk_show_uri_full(GTK_WINDOW(root), uri, GDK_CURRENT_TIME, NULL, help_button_finish, uri);
+    gtk_show_uri_full(GTK_WINDOW(root), uri, GDK_CURRENT_TIME, NULL,
+                      help_pbox_display_finish, g_strdup(uri));
 
     g_free(uri);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]