Hello!

I believe this will fix a memory leak in src/search.c. But please double-check!

At lines 1417-1422 the search_text is allocated:
        if (enc != NULL && g_utf8_validate(utf8_search_text, utf8_text_len, 
NULL))
        {
                search_text = g_convert(utf8_search_text, utf8_text_len, enc,
"UTF-8", NULL, NULL, NULL);
        }
        if (search_text == NULL)
                search_text = g_strdup(utf8_search_text);


The only usage of search_text between the lines 1417-1456 is:
        argv_prefix[i++] = g_strdup(search_text);


At line 1456 there is this code:
        if (argv == NULL)       /* no files */
        {
                g_strfreev(argv);
                return FALSE;
        }


I assume that a "g_free(search_text);" is needed before the return.

Best regards,
Daniel
Index: src/search.c
===================================================================
--- src/search.c	(revision 5115)
+++ src/search.c	(arbetskopia)
@@ -1455,6 +1455,7 @@
 
 	if (argv == NULL)	/* no files */
 	{
+		g_free(search_text);
 		g_strfreev(argv);
 		return FALSE;
 	}
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to