pidgin: f4c4106a: Plug leaks from incorrect color types/na..

sadrul at pidgin.im sadrul at pidgin.im
Fri Oct 2 08:55:32 EDT 2009


-----------------------------------------------------------------
Revision: f4c4106a9ee0234db09b269d26c98f0b8370a3ba
Ancestor: b83d8cf6b5183d999a1b50c3d121353b550676dd
Author: sadrul at pidgin.im
Date: 2009-09-30T17:55:16
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f4c4106a9ee0234db09b269d26c98f0b8370a3ba

Modified files:
        finch/libgnt/gntcolors.c

ChangeLog: 

Plug leaks from incorrect color types/names in gntrc.

-------------- next part --------------
============================================================
--- finch/libgnt/gntcolors.c	2611e83d7b098cbb3c61b94bc3ecd516eedc4c79
+++ finch/libgnt/gntcolors.c	2b20a0a771628db4f93bad108cfd6ba0ce8757dc
@@ -208,8 +208,10 @@ void gnt_colors_parse(GKeyFile *kfile)
 				key = g_ascii_strdown(key, -1);
 				color = gnt_colors_get_color(key);
 				g_free(key);
-				if (color == -EINVAL)
+				if (color == -EINVAL) {
+					g_strfreev(list);
 					continue;
+				}
 
 				init_color(color, r, g, b);
 			}
@@ -251,8 +253,10 @@ void gnt_color_pairs_parse(GKeyFile *kfi
 			int bg = gnt_colors_get_color(bgc);
 			g_free(fgc);
 			g_free(bgc);
-			if (fg == -EINVAL || bg == -EINVAL)
+			if (fg == -EINVAL || bg == -EINVAL) {
+				g_strfreev(list);
 				continue;
+			}
 
 			key = g_ascii_strdown(key, -1);
 
@@ -275,6 +279,7 @@ void gnt_color_pairs_parse(GKeyFile *kfi
 			else if (strcmp(key, "urgent") == 0)
 				type = GNT_COLOR_URGENT;
 			else {
+				g_strfreev(list);
 				g_free(key);
 				continue;
 			}


More information about the Commits mailing list