[Gnucash-changes] r11906 - gnucash/trunk - Eliminate double free of memory by just freeing default_dir once at

David Hampton hampton at cvs.gnucash.org
Fri Nov 11 10:13:20 EST 2005


Author: hampton
Date: 2005-11-11 10:13:18 -0500 (Fri, 11 Nov 2005)
New Revision: 11906

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c
Log:
Eliminate double free of memory by just freeing default_dir once at
the end of the function.  The gnc_extract_directory() routine will
handle any intermediate freeing if called multiple times.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-11-11 14:16:12 UTC (rev 11905)
+++ gnucash/trunk/ChangeLog	2005-11-11 15:13:18 UTC (rev 11906)
@@ -1,5 +1,10 @@
 2005-11-11  David Hampton  <hampton at employees.org>
 
+	* src/import-export/log-replay/gnc-log-replay.c: Eliminate double
+	free of memory by just freeing default_dir once at the end of the
+	function.  The gnc_extract_directory() routine will handle any
+	intermediate freeing if called multiple times.
+
 	* src/app-utils/file-utils.[ch]:
 	* src/app-utils/guile-util.[ch]:
 	* src/business/business-gnome/gnc-plugin-business.c:

Modified: gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c
===================================================================
--- gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c	2005-11-11 14:16:12 UTC (rev 11905)
+++ gnucash/trunk/src/import-export/log-replay/gnc-log-replay.c	2005-11-11 15:13:18 UTC (rev 11906)
@@ -514,14 +514,12 @@
 				      NULL,
 				      default_dir,
 				      GNC_FILE_DIALOG_OPEN);
-  g_free(default_dir);
 
   if(selected_filename!=NULL)
     {
       /* Remember the directory as the default. */
       gnc_extract_directory(&default_dir, selected_filename);
       gnc_gconf_set_string(GCONF_SECTION, KEY_LAST_PATH, default_dir, NULL);
-      g_free(default_dir);
 
       /*strncpy(file,selected_filename, 255);*/
       DEBUG("Filename found: %s",selected_filename);
@@ -562,7 +560,7 @@
 	}
       g_free(selected_filename);
     }
-  
+  g_free(default_dir);
 }
 
 



More information about the gnucash-changes mailing list