changeset 1663:dcb0b4522ded

Fix GError handling
author Myhailo Danylenko <isbear@ukrpost.net>
date Wed, 13 Jan 2010 12:43:57 +0200
parents 63ebb1d32c7d
children 2f6bdfa0cb01
files mcabber/src/screen.c mcabber/src/xmpp.c
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sat Dec 12 16:23:21 2009 +0200
+++ b/mcabber/src/screen.c	Wed Jan 13 12:43:57 2010 +0200
@@ -2043,14 +2043,13 @@
 static inline void scr_LogUrls(const gchar *string)
 {
   GMatchInfo *match_info;
-  GError *error = NULL;
-
-  g_regex_match_full(url_regex, string, -1, 0, 0, &match_info, &error);
+
+  g_regex_match_full(url_regex, string, -1, 0, 0, &match_info, NULL);
   while (g_match_info_matches(match_info)) {
     gchar *url = g_match_info_fetch(match_info, 0);
     scr_print_logwindow(url);
     g_free(url);
-    g_match_info_next(match_info, &error);
+    g_match_info_next(match_info, NULL);
   }
   g_match_info_free(match_info);
 }
--- 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);
   }
 }