pidgin: 387760c8: gtksourceiter: Fix a few memory leaks in...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Wed Jan 5 11:32:07 EST 2011


----------------------------------------------------------------------
Revision: 387760c8bb12bfb6c9bd7a5d8b4deb404ea27307
Parent:   c6f66fc01b05e7582a4e5074b75cf7d8bdb632c9
Author:   morshed.nader at gmail.com
Date:     01/05/11 11:22:00
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/387760c8bb12bfb6c9bd7a5d8b4deb404ea27307

Changelog: 

gtksourceiter: Fix a few memory leaks in our bundled copy of this widget.  Refs #13162.

Changes against parent c6f66fc01b05e7582a4e5074b75cf7d8bdb632c9

  patched  pidgin/gtksourceiter.c

-------------- next part --------------
============================================================
--- pidgin/gtksourceiter.c	4c8ee3673af4ee9bae78b8e25dccb724ed6803d7
+++ pidgin/gtksourceiter.c	5abeaed1a4f637cec876274f38273dcba6b49224
@@ -154,7 +154,7 @@ g_utf8_strrcasestr (const gchar *haystac
 	p = g_utf8_offset_to_pointer (caseless_haystack, i);
 	needle_len = strlen (needle);
 
-	while (p >= caseless_haystack)
+	while (1)
 	{
 		if (strncmp (p, needle, needle_len) == 0)
 		{
@@ -162,7 +162,11 @@ g_utf8_strrcasestr (const gchar *haystac
 			goto finally_1;
 		}
 
-		p = g_utf8_prev_char (p);
+		if (p > caseless_haystack)
+			p = g_utf8_prev_char (p);
+		else
+			goto finally_1;
+
 		i--;
 	}
 


More information about the Commits mailing list