diff mcabber/src/xmpp.c @ 1663:dcb0b4522ded

Fix GError handling
author Myhailo Danylenko <isbear@ukrpost.net>
date Wed, 13 Jan 2010 12:43:57 +0200
parents fbab3c1300d5
children 1a4890514eb9
line wrap: on
line diff
--- a/mcabber/src/xmpp.c	Sat Dec 12 16:23:21 2009 +0200
+++ b/mcabber/src/xmpp.c	Wed Jan 13 12:43:57 2010 +0200
@@ -854,7 +854,7 @@
 static void connection_open_cb(LmConnection *connection, gboolean success,
                                gpointer user_data)
 {
-  GError *error;
+  GError *error = NULL;
 
   if (success) {
     const char *password, *resource;
@@ -870,6 +870,7 @@
                                     connection_auth_cb, NULL, FALSE, &error)) {
       scr_LogPrint(LPRINT_LOGNORM, "Failed to authenticate: %s\n",
                    error->message);
+      g_error_free (error);
       _try_to_reconnect();
     }
     g_free(username);
@@ -1750,6 +1751,7 @@
                           NULL, FALSE, &error)) {
     _try_to_reconnect();
     scr_LogPrint(LPRINT_LOGNORM, "Failed to open: %s\n", error->message);
+    g_error_free (error);
   }
 }