gnucash maint: Bug 748983 - Crash after opening money transfer dialog twice

John Ralls jralls at code.gnucash.org
Wed Jun 22 15:54:04 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/1b3f7112 (commit)
	from  https://github.com/Gnucash/gnucash/commit/5ed88771 (commit)



commit 1b3f711287261dd43318f9f6046a0097b0e3bd1b
Author: John Ralls <jralls at ceridwen.us>
Date:   Wed Jun 22 12:47:26 2016 -0700

    Bug 748983 - Crash after opening money transfer dialog twice
    
    Prevent re-entrance by checking that the static pointers, the second
    freeing of which caused the crash. Set said pointers to NULL after
    freeing them to make the dialog ready for the next invocation.

diff --git a/src/gnome-utils/dialog-transfer.c b/src/gnome-utils/dialog-transfer.c
index eefc5d1..cc2a963 100644
--- a/src/gnome-utils/dialog-transfer.c
+++ b/src/gnome-utils/dialog-transfer.c
@@ -1871,6 +1871,7 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData)
 {
     GtkBuilder *builder;
     gboolean  use_accounting_labels;
+    g_return_if_fail(to_info == NULL && from_info == NULL);
 
     use_accounting_labels = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL,
                                                GNC_PREF_ACCOUNTING_LABELS);
@@ -2067,7 +2068,9 @@ close_handler (gpointer user_data)
     gnc_xfer_dialog_close_cb(GTK_DIALOG(dialog), xferData);
     gtk_widget_destroy (dialog);
     g_free (to_info);
+    to_info = NULL;
     g_free (from_info);
+    from_info = NULL;
     LEAVE(" ");
 }
 



Summary of changes:
 src/gnome-utils/dialog-transfer.c | 3 +++
 1 file changed, 3 insertions(+)



More information about the gnucash-changes mailing list