r17115 - gnucash/branches/2.2/src/core-utils - [r17093] Free two GErrors after they have been logged.

Andreas Köhler andi5 at cvs.gnucash.org
Sun Apr 20 15:25:30 EDT 2008


Author: andi5
Date: 2008-04-20 15:25:30 -0400 (Sun, 20 Apr 2008)
New Revision: 17115
Trac: http://svn.gnucash.org/trac/changeset/17115

Modified:
   gnucash/branches/2.2/src/core-utils/gnc-glib-utils.c
Log:
[r17093] Free two GErrors after they have been logged.


Modified: gnucash/branches/2.2/src/core-utils/gnc-glib-utils.c
===================================================================
--- gnucash/branches/2.2/src/core-utils/gnc-glib-utils.c	2008-04-20 19:25:21 UTC (rev 17114)
+++ gnucash/branches/2.2/src/core-utils/gnc-glib-utils.c	2008-04-20 19:25:30 UTC (rev 17115)
@@ -213,8 +213,10 @@
 
   /* Convert from UTF-8 to the encoding used in the current locale. */
   locale_str = g_locale_from_utf8(str, -1, NULL, &bytes_written, &err);
-  if (err)
+  if (err) {
     g_warning("g_locale_from_utf8 failed: %s", err->message);
+    g_error_free(err);
+  }
 
   return locale_str;
 }
@@ -228,8 +230,10 @@
 
   /* Convert to UTF-8 from the encoding used in the current locale. */
   utf8_str = g_locale_to_utf8(str, -1, NULL, &bytes_written, &err);
-  if (err)
+  if (err) {
     g_warning("g_locale_to_utf8 failed: %s", err->message);
+    g_error_free(err);
+  }
 
   return utf8_str;
 }



More information about the gnucash-changes mailing list