r22193 - gnucash/trunk/src/libqof/qof - Fix some small problems (including a memory leak) found by running qof unit test with valgrind.

Phil Longstaff plongstaff at code.gnucash.org
Mon May 21 14:35:59 EDT 2012


Author: plongstaff
Date: 2012-05-21 14:35:59 -0400 (Mon, 21 May 2012)
New Revision: 22193
Trac: http://svn.gnucash.org/trac/changeset/22193

Modified:
   gnucash/trunk/src/libqof/qof/gnc-date.c
   gnucash/trunk/src/libqof/qof/qofsession.c
Log:
Fix some small problems (including a memory leak) found by running qof unit test with valgrind.


Modified: gnucash/trunk/src/libqof/qof/gnc-date.c
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-date.c	2012-05-21 18:35:04 UTC (rev 22192)
+++ gnucash/trunk/src/libqof/qof/gnc-date.c	2012-05-21 18:35:59 UTC (rev 22193)
@@ -1479,6 +1479,7 @@
 GDate gnc_dmy2gdate (gint day, gint month, gint year)
 {
     GDate result;
+    g_date_clear(&result, 1);
     g_date_set_day (&result, day);
     g_date_set_month (&result, month);
     g_date_set_year (&result, year);

Modified: gnucash/trunk/src/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.c	2012-05-21 18:35:04 UTC (rev 22192)
+++ gnucash/trunk/src/libqof/qof/qofsession.c	2012-05-21 18:35:59 UTC (rev 22193)
@@ -1066,6 +1066,7 @@
     }
     msg = g_strdup_printf("failed to load '%s' using access_method", access_method);
     qof_session_push_error (session, ERR_BACKEND_NO_HANDLER, msg);
+    g_free(msg);
     LEAVE (" ");
 }
 



More information about the gnucash-changes mailing list