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.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11906 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2005-11-11 15:13:18 +00:00
parent 817dd3687f
commit 12c39d5492
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,10 @@
2005-11-11 David Hampton <hampton@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:

View File

@ -514,14 +514,12 @@ void gnc_file_log_replay (void)
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 @@ void gnc_file_log_replay (void)
}
g_free(selected_filename);
}
g_free(default_dir);
}