[Telepathy-commits] [telepathy-idle/master] Initialize all GError* vars to NULL

Jonathon Jongsma jonathon.jongsma at collabora.co.uk
Mon Jan 12 14:32:21 PST 2009


We were getting some warnings about an error being set over top of an existing
error, because several GError* variables were not initialized properly to NULL.
---
 src/idle-connection.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/idle-connection.c b/src/idle-connection.c
index 7d03db3..6c2d645 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -437,7 +437,7 @@ static void _iface_disconnected(TpBaseConnection *self) {
 
 static void _iface_shut_down(TpBaseConnection *self) {
 	IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE(self);
-	GError *error;
+	GError *error = NULL;
 
 	if (priv->quitting)
 		return;
@@ -583,7 +583,7 @@ static gboolean msg_queue_timeout_cb(gpointer user_data) {
 	int i, j;
 	IdleOutputPendingMsg *output_msg;
 	gchar msg[IRC_MSG_MAXLEN + 3];
-	GError *error;
+	GError *error = NULL;
 
 	IDLE_DEBUG("called");
 
@@ -636,9 +636,9 @@ static void _send_with_priority(IdleConnection *conn, const gchar *msg, guint pr
 	gchar cmd[IRC_MSG_MAXLEN + 3];
 	IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE(conn);
 	int len;
-	GError *error;
+	GError *error = NULL;
 	gchar *converted;
-	GError *convert_error;
+	GError *convert_error = NULL;
 	time_t curr_time = time(NULL);
 	IdleOutputPendingMsg *output_msg;
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list