Avoids a double-free
authorMichael Schwendt <[email protected]>
Mon, 24 Dec 2012 13:24:27 +0000 (14:24 +0100)
committerKlaus Ethgen <[email protected]>
Thu, 5 May 2016 12:25:19 +0000 (13:25 +0100)
Avoids a double-free due to a boolean that would be retrieved from a
deleted/freed structure.

Fix #361.

Signed-off-by: Klaus Ethgen <[email protected]>
src/ui_utildlg.c

index c4bfaaf9bd9f5ddb41ea636d1b16f3f335b19a82..743d0a81066ff74551352ae07ab39b4b81a8422c 100644 (file)
@@ -86,11 +86,12 @@ void generic_dialog_attach_default(GenericDialog *gd, GtkWidget *widget)
 static gboolean generic_dialog_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
        GenericDialog *gd = data;
+       gboolean auto_close = gd->auto_close;
 
        if (event->keyval == GDK_KEY_Escape)
                {
                if (gd->cancel_cb) gd->cancel_cb(gd, gd->data);
-               else if (gd->auto_close) generic_dialog_click_cb(widget, data);
+               else if (auto_close) generic_dialog_click_cb(widget, data);
                return TRUE;
                }
        return FALSE;