changeset 16132:9699941af4c4

Fix a memory leak that occurs when a smiley theme lists a filename, but no smileys for that file. This is rare. Our default theme is missing the smiley characters for disdain.png, by the way
author Mark Doliner <mark@kingant.net>
date Sun, 15 Apr 2007 17:47:45 +0000
parents f0c6a91bfd67
children 019092f88c43 74b2d576f458
files pidgin/gtkthemes.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkthemes.c	Sun Apr 15 17:06:53 2007 +0000
+++ b/pidgin/gtkthemes.c	Sun Apr 15 17:47:45 2007 +0000
@@ -141,6 +141,7 @@
 		} else if (load && list) {
 			gboolean hidden = FALSE;
 			char *sfile = NULL;
+			gboolean have_used_sfile = FALSE;
 
 			if (*i == '!' && *(i + 1) == ' ') {
 				hidden = TRUE;
@@ -164,11 +165,14 @@
 					smiley->smile = g_strdup(l);
 					smiley->hidden = hidden;
 					list->smileys = g_slist_append(list->smileys, smiley);
+					have_used_sfile = TRUE;
 				}
 				while (isspace(*i))
 					i++;
 
 			}
+			if (!have_used_sfile)
+				g_free(sfile);
 		}
 	}