[gtranslator] Don't leak the msgid text when copying it to the msgstr



commit 69183ae809dd8b340a93d9fafd0cc862a42b8ea7
Author: Colomban Wendling <ban herbesfolles org>
Date:   Sun Nov 7 22:55:14 2010 +0100

    Don't leak the msgid text when copying it to the msgstr

 src/gtr-tab.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 134f6ad..5082840 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -1402,7 +1402,7 @@ gtr_tab_copy_to_translation (GtrTab * tab)
 {
   GtkTextBuffer *msgstr, *msgid;
   gint page_index;
-  const gchar *text;
+  gchar *text;
   GtkTextIter start, end;
 
   g_return_if_fail (GTR_IS_TAB (tab));
@@ -1418,6 +1418,7 @@ gtr_tab_copy_to_translation (GtrTab * tab)
   gtk_text_buffer_get_bounds (msgid, &start, &end);
   text = gtk_text_buffer_get_text (msgid, &start, &end, FALSE);
   gtk_text_buffer_set_text (msgstr, text, -1);
+  g_free (text);
   gtk_text_buffer_end_user_action (msgstr);
 }
 



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