/soc/2013/ankitkv/gobjectification: c4c1e8d8918a: Added some checks

Ankit Vani a at nevitus.org
Mon Sep 2 08:12:33 EDT 2013


Changeset: c4c1e8d8918a6cdfe87521d54a54ef9a12fc5285
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-02 17:39 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/c4c1e8d8918a

Description:

Added some checks

diffstat:

 libpurple/keyring.c         |   2 +-
 libpurple/plugins/ssl/ssl.c |  10 ++++++----
 pidgin/gtkdialogs.c         |   2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)

diffs (58 lines):

diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -1289,7 +1289,7 @@ purple_keyring_init(void)
 		PurplePlugin *plugin = PURPLE_PLUGIN(it->data);
 		PurplePluginInfo *info = purple_plugin_get_info(plugin);
 
-		if (info == NULL || purple_plugin_info_get_id(info) == NULL)
+		if (info == NULL)
 			continue;
 
 		if (strncmp(purple_plugin_info_get_id(info), "keyring-", 8) != 0)
diff --git a/libpurple/plugins/ssl/ssl.c b/libpurple/plugins/ssl/ssl.c
--- a/libpurple/plugins/ssl/ssl.c
+++ b/libpurple/plugins/ssl/ssl.c
@@ -34,6 +34,7 @@ static gboolean
 probe_ssl_plugins(PurplePlugin *my_plugin, GError **error)
 {
 	PurplePlugin *plugin;
+	PurplePluginInfo *info;
 	GList *plugins, *l;
 
 	ssl_plugin = NULL;
@@ -43,17 +44,18 @@ probe_ssl_plugins(PurplePlugin *my_plugi
 	for (l = plugins; l != NULL; l = l->next)
 	{
 		plugin = PURPLE_PLUGIN(l->data);
-
 		if (plugin == my_plugin)
 			continue;
 
-		if (strncmp(purple_plugin_info_get_id(purple_plugin_get_info(plugin)),
-				"ssl-", 4) == 0)
+		info = purple_plugin_get_info(plugin);
+		if (!info)
+			continue;
+
+		if (strncmp(purple_plugin_info_get_id(info), "ssl-", 4) == 0)
 		{
 			if (purple_plugin_load(plugin, NULL))
 			{
 				ssl_plugin = plugin;
-
 				break;
 			}
 		}
diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -847,6 +847,8 @@ void pidgin_dialogs_plugins_info(void)
 	for(l = plugins; l; l = l->next) {
 		plugin = PURPLE_PLUGIN(l->data);
 		info = purple_plugin_get_info(plugin);
+		if (!info)
+			continue;
 
 		pname = g_markup_escape_text(purple_plugin_info_get_name(info), -1);
 		authorlist = purple_plugin_info_get_authors(info);



More information about the Commits mailing list