soc.2009.telepathy: e05953a5: Added parameter checks for telepathy_con...

sttwister at gmail.com sttwister at gmail.com
Thu Oct 15 15:55:38 EDT 2009


-----------------------------------------------------------------
Revision: e05953a516e4ebbfa4d862b4d19388de35ad534f
Ancestor: 2c6a8a67424c07def9d8ae05d528ef258545e974
Author: sttwister at gmail.com
Date: 2009-10-14T18:21:40
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/e05953a516e4ebbfa4d862b4d19388de35ad534f

Modified files:
        libpurple/protocols/telepathy/telepathy_connection.c

ChangeLog: 

Added parameter checks for telepathy_connection.c

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy_connection.c	1d8852eecde5d9dc3d0c3d9fc31865268e9df1c3
+++ libpurple/protocols/telepathy/telepathy_connection.c	9bd37c852492b9b213fde274e86d006ef40452e5
@@ -39,10 +39,16 @@ connection_status_changed (gpointer data
                            guint arg_Status,
 			   guint arg_Reason)
 {
-	PrplTpAccount *account_data = data;
-	PrplTpConnection *connection_data = account_data->connection_data;
-	PurpleConnection *gc = purple_account_get_connection(account_data->account);
+	PrplTpAccount *account_data;
+	PrplTpConnection *connection_data;
+	PurpleConnection *gc;
 
+	g_return_if_fail(data != NULL);
+
+	account_data = data;
+	connection_data = account_data->connection_data;
+	gc = purple_account_get_connection(account_data->account);
+
 	if (arg_Status == TP_CONNECTION_STATUS_CONNECTED)
 	{
 		purple_debug_info("telepathy", "Connected!\n");
@@ -195,12 +201,17 @@ got_connection_object (gchar *connection
 
 	PrplTpConnection *connection_data;
 	PrplTpAccount *account_data = data;
+	PurpleAccount *acct;
+	PurpleConnection *gc;
+	TpDBusDaemon *daemon;
 
-	PurpleAccount *acct = account_data->account;
-	PurpleConnection *gc = purple_account_get_connection(acct);
+	g_return_if_fail(data != NULL);
 
-	TpDBusDaemon *daemon = tp_dbus_daemon_dup(&error);
+	acct = account_data->account;
+	gc = purple_account_get_connection(acct);
 
+	daemon = tp_dbus_daemon_dup(&error);
+
 	if (error != NULL)
 	{
 		purple_debug_error("telepathy", "Error creating dbus daemon: %s\n", error->message);
@@ -248,6 +259,8 @@ status_changed_cb (TpConnection *proxy,
 {
 	PrplTpConnection *data = user_data;
 
+	g_return_if_fail(user_data != NULL);
+
 	if (arg_Status == TP_CONNECTION_STATUS_CONNECTED)
 	{
 		purple_debug_info("telepathy", "Connected!\n");
@@ -419,6 +432,8 @@ connection_ready_cb (TpConnection *conne
 		GError *error = NULL;
 		PrplTpConnection *data = user_data;
 
+		g_return_if_fail(user_data != NULL);
+
 		purple_debug_info("telepathy", "Connection is ready. Interfaces implemented:\n");
 
 		/* query interfaces */


More information about the Commits mailing list