r16756 - gnucash/trunk/lib/libqof/qof - Fix two memory leaks.

Andreas Köhler andi5 at cvs.gnucash.org
Fri Dec 28 16:44:25 EST 2007


Author: andi5
Date: 2007-12-28 16:44:25 -0500 (Fri, 28 Dec 2007)
New Revision: 16756
Trac: http://svn.gnucash.org/trac/changeset/16756

Modified:
   gnucash/trunk/lib/libqof/qof/qofbackend.c
   gnucash/trunk/lib/libqof/qof/qofquerycore.c
Log:
Fix two memory leaks.


Modified: gnucash/trunk/lib/libqof/qof/qofbackend.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbackend.c	2007-12-28 14:45:40 UTC (rev 16755)
+++ gnucash/trunk/lib/libqof/qof/qofbackend.c	2007-12-28 21:44:25 UTC (rev 16756)
@@ -393,6 +393,7 @@
 	g_return_val_if_fail(g_module_supported(), FALSE);
 	fullpath = g_module_build_path(directory, module_name);
 	backend = g_module_open(fullpath, G_MODULE_BIND_LAZY);
+	g_free(fullpath);
 	if (!backend) {
 		g_message ("%s: %s\n", PACKAGE, g_module_error ());
 		return FALSE;

Modified: gnucash/trunk/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-12-28 14:45:40 UTC (rev 16755)
+++ gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-12-28 21:44:25 UTC (rev 16756)
@@ -222,9 +222,8 @@
 
   if (pdata->is_regex)
     regfree (&pdata->compiled);
-  else
-    g_free (pdata->matchstring);
 
+  g_free (pdata->matchstring);
   g_free (pdata);
 }
 



More information about the gnucash-changes mailing list