[gnome-builder] command-bar: Fix memory leak



commit 06165f7ddde2d32005fa35dd851aa45ae9458681
Author: Matthew Leeds <mleeds redhat com>
Date:   Thu Feb 2 17:19:05 2017 -0600

    command-bar: Fix memory leak

 plugins/command-bar/gb-vim.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/plugins/command-bar/gb-vim.c b/plugins/command-bar/gb-vim.c
index 73c77ee..3ab1865 100644
--- a/plugins/command-bar/gb-vim.c
+++ b/plugins/command-bar/gb-vim.c
@@ -1013,8 +1013,8 @@ gb_vim_command_search (GtkWidget      *active_widget,
   const gchar *search_end = NULL;
   const gchar *replace_begin = NULL;
   const gchar *replace_end = NULL;
-  gchar *search_text = NULL;
-  gchar *replace_text = NULL;
+  g_autofree gchar *search_text = NULL;
+  g_autofree gchar *replace_text = NULL;
   gunichar separator;
   gboolean confirm_replace = FALSE;
 
@@ -1134,9 +1134,6 @@ gb_vim_command_search (GtkWidget      *active_widget,
   else
     gb_vim_do_search_and_replace (buffer, NULL, NULL, search_text, replace_text, TRUE);
 
-  g_free (search_text);
-  g_free (replace_text);
-
   return TRUE;
 
 invalid_request:


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