changeset 13962:b43aec5fa9eb

[gaim-migrate @ 16515] Fix a tiny and rare memleak when unloading a plugin that was designed for an older version of Gaim. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 18 Jul 2006 06:33:36 +0000
parents b0e37dcb3987
children f7cfaee79982
files plugins/dbus-example.c src/plugin.c src/protocols/msn/user.c
diffstat 3 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/dbus-example.c	Mon Jul 17 23:57:12 2006 +0000
+++ b/plugins/dbus-example.c	Tue Jul 18 06:33:36 2006 +0000
@@ -152,7 +152,7 @@
 	GAIM_PRIORITY_DEFAULT,                            /**< priority       */
 
 	"dbus-example",                                   /**< id             */
-	N_("DBus"),                        /**< name           */
+	N_("DBus Example"),                               /**< name           */
 	VERSION,                                          /**< version        */
 	                                                  /**  summary        */
 	N_("DBus Plugin Example"),
--- a/src/plugin.c	Mon Jul 17 23:57:12 2006 +0000
+++ b/src/plugin.c	Tue Jul 18 06:33:36 2006 +0000
@@ -772,12 +772,16 @@
 	 * mismatch, but it's a lot better than trying to free something
 	 * we shouldn't, and crashing while trying to load an old plugin */
 	if(plugin->info == NULL || plugin->info->magic != GAIM_PLUGIN_MAGIC ||
-			plugin->info->major_version != GAIM_MAJOR_VERSION) {
+			plugin->info->major_version != GAIM_MAJOR_VERSION)
+	{
 		if(plugin->handle)
 			g_module_close(plugin->handle);
 
+		g_free(plugin->path);
+		g_free(plugin->error);
+
 		GAIM_DBUS_UNREGISTER_POINTER(plugin);
-	
+
 		g_free(plugin);
 		return;
 	}
--- a/src/protocols/msn/user.c	Mon Jul 17 23:57:12 2006 +0000
+++ b/src/protocols/msn/user.c	Tue Jul 18 06:33:36 2006 +0000
@@ -55,6 +55,12 @@
 {
 	g_return_if_fail(user != NULL);
 
+	/*
+	 * TODO: If any GaimBuddy->proto_data pointers point to this
+	 *       MsnUser then set them to NULL.  Or possibly even better,
+	 *       don't set GaimBuddy->proto_data in the first place.
+	 */
+
 	if (user->clientcaps != NULL)
 		g_hash_table_destroy(user->clientcaps);