diff src/gtkthemes.c @ 14035:8bda65b88e49

[gaim-migrate @ 16638] A bunch of small changes. Mostly remove "if not null" checks before calling g_free, g_list_free, g_slist_free and g_strdup. Also use g_list_foreach() to call g_free to free strings in an array. And some whitespace changes here and there. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Aug 2006 08:27:39 +0000
parents ff70d3009409
children
line wrap: on
line diff
--- a/src/gtkthemes.c	Sat Aug 05 05:42:28 2006 +0000
+++ b/src/gtkthemes.c	Sat Aug 05 08:27:39 2006 +0000
@@ -119,23 +119,19 @@
 				theme->list = child;
 			list = child;
 		} else if (!g_ascii_strncasecmp(i, "Name=", strlen("Name="))) {
-			if(theme->name)
-				g_free(theme->name);
+			g_free(theme->name);
 			theme->name = g_strdup(i+ strlen("Name="));
 			theme->name[strlen(theme->name)-1] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Description=", strlen("Description="))) {
-			if(theme->desc)
-				g_free(theme->desc);
+			g_free(theme->desc);
 			theme->desc = g_strdup(i + strlen("Description="));
 			theme->desc[strlen(theme->desc)-1] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Icon=", strlen("Icon="))) {
-			if(theme->icon)
-				g_free(theme->icon);
+			g_free(theme->icon);
 			theme->icon = g_build_filename(dirname, i + strlen("Icon="), NULL);
 			theme->icon[strlen(theme->icon)-1] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Author=", strlen("Author="))) {
-			if(theme->author)
-				g_free(theme->author);
+			g_free(theme->author);
 			theme->author = g_strdup(i + strlen("Author="));
 			theme->author[strlen(theme->author)-1] = 0;
 		} else if (load && list) {