diff src/plugin.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 b43aec5fa9eb
children 7f0e6b3f4832
line wrap: on
line diff
--- a/src/plugin.c	Sat Aug 05 05:42:28 2006 +0000
+++ b/src/plugin.c	Sat Aug 05 08:27:39 2006 +0000
@@ -190,7 +190,7 @@
 	plugin = g_new0(GaimPlugin, 1);
 
 	plugin->native_plugin = native;
-	plugin->path = (path == NULL ? NULL : g_strdup(path));
+	plugin->path = g_strdup(path);
 
 	GAIM_DBUS_REGISTER_POINTER(plugin, GaimPlugin);
 
@@ -528,8 +528,7 @@
 			                  _("Gaim encountered errors loading the plugin."), tmp);
 			g_free(tmp);
 
-			if (dep_list != NULL)
-				g_list_free(dep_list);
+			g_list_free(dep_list);
 
 			return FALSE;
 		}
@@ -555,8 +554,7 @@
 				                 _("Gaim was unable to load your plugin."), tmp);
 				g_free(tmp);
 
-				if (dep_list != NULL)
-					g_list_free(dep_list);
+				g_list_free(dep_list);
 
 				return FALSE;
 			}
@@ -571,8 +569,7 @@
 		dep_plugin->dependent_plugins = g_list_prepend(dep_plugin->dependent_plugins, plugin->info->id);
 	}
 
-	if (dep_list != NULL)
-		g_list_free(dep_list);
+	g_list_free(dep_list);
 
 	if (plugin->native_plugin)
 	{
@@ -786,7 +783,7 @@
 		return;
 	}
 
-	if (plugin->info != NULL && plugin->info->dependencies != NULL)
+	if (plugin->info != NULL)
 		g_list_free(plugin->info->dependencies);
 
 	if (plugin->native_plugin)