Hi!

I found a little memory leak caused by a none free'd g_strconcat.

Daniel
From 82f202e86a62f9d1429ef2fa44f1e1f8d524e2bb Mon Sep 17 00:00:00 2001
From: Daniel Carl <[email protected]>
Date: Fri, 2 Nov 2012 20:05:12 +0100
Subject: [PATCH] Fixed missed g_free after g_strconcat().

---
 main.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index b6568cd..a0cd3ea 100644
--- a/main.c
+++ b/main.c
@@ -1675,6 +1675,7 @@ fake_key_event(const Arg *a) {
 gboolean
 commandhistoryfetch(const Arg *arg) {
     const int length = g_list_length(commandhistory);
+    gchar *input_message = NULL;
 
     if (length > 0) {
         if (arg->i == DirectionPrev) {
@@ -1684,7 +1685,9 @@ commandhistoryfetch(const Arg *arg) {
         }
 
         const char* command = (char *)g_list_nth_data(commandhistory, commandpointer);
-        gtk_entry_set_text(GTK_ENTRY(inputbox), g_strconcat(":", command, NULL));
+        input_message = g_strconcat(":", command, NULL);
+        gtk_entry_set_text(GTK_ENTRY(inputbox), input_message);
+        g_free(input_message);
         gtk_editable_set_position(GTK_EDITABLE(inputbox), -1);
         return TRUE;
     }
-- 
1.7.9.5

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Vimprobable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vimprobable-users

Reply via email to