changeset 28311:f22eadbdc5d1

Plug leaks from incorrect color types/names in gntrc.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 30 Sep 2009 17:55:16 +0000
parents 7eaf2561b6dd
children ec2782028fc5
files finch/libgnt/gntcolors.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntcolors.c	Wed Sep 30 15:20:25 2009 +0000
+++ b/finch/libgnt/gntcolors.c	Wed Sep 30 17:55:16 2009 +0000
@@ -208,8 +208,10 @@
 				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 @@
 			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 @@
 			else if (strcmp(key, "urgent") == 0)
 				type = GNT_COLOR_URGENT;
 			else {
+				g_strfreev(list);
 				g_free(key);
 				continue;
 			}