[gimp] app: string allocated by gtk_tree_path_to_string() must be freed.



commit ef56fed9cb79a48ad36dd8831761370e240af9c1
Author: Jehan <jehan girinstud io>
Date:   Fri Aug 20 21:43:55 2021 +0200

    app: string allocated by gtk_tree_path_to_string() must be freed.
    
    Thanks again to Massimo for the report!

 app/widgets/gimpsearchpopup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpsearchpopup.c b/app/widgets/gimpsearchpopup.c
index b864040269..1fc8323eb5 100644
--- a/app/widgets/gimpsearchpopup.c
+++ b/app/widgets/gimpsearchpopup.c
@@ -616,8 +616,10 @@ results_list_key_press_event (GtkWidget       *widget,
         if (gtk_tree_selection_get_selected (selection, &model, &iter))
           {
             GtkTreePath *path = gtk_tree_model_get_path (model, &iter);
+            gchar       *path_str;
 
-            if (strcmp (gtk_tree_path_to_string (path), "0") == 0)
+            path_str = gtk_tree_path_to_string (path);
+            if (strcmp (path_str, "0") == 0)
               {
                 gint start_pos;
                 gint end_pos;
@@ -631,6 +633,7 @@ results_list_key_press_event (GtkWidget       *widget,
                 event_processed = TRUE;
               }
 
+            g_free (path_str);
             gtk_tree_path_free (path);
           }
 


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