Skip to content

Commit

Permalink
Avoids a double-free
Browse files Browse the repository at this point in the history
Avoids a double-free due to a boolean that would be retrieved from a
deleted/freed structure.

Fix #361.

Signed-off-by: Klaus Ethgen <Klaus@Ethgen.de>
  • Loading branch information
mschwendt authored and mowgli committed May 5, 2016
1 parent 82a1755 commit 2a564f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui_utildlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a564f2

Please sign in to comment.