diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-17 19:19:24 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-17 19:29:57 -0400 |
commit | 05d667918d08c15c1d6748e5d2129f1594cfbd84 (patch) | |
tree | c8d99a416ac131172a2e5680f379fec01996cc6c | |
parent | d4d40d5e2bc892306fd0dd0de5c1bb436ac1f013 (diff) | |
download | gtk+-05d667918d08c15c1d6748e5d2129f1594cfbd84.tar.gz |
GtkWindow: Fix a use-after-free
We were printing a string in a warning after freeing it.
Also, fix an x/y typo that might cause popovers to be
mispositioned.
-rw-r--r-- | gtk/gtkwindow.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 126f19cbc7..a68ed94962 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6263,7 +6263,7 @@ popover_get_rect (GtkWindowPopover *popover, { rect->y = popover->rect.y + popover->rect.height; - if (rect->y + rect->height < win_alloc.x + win_alloc.height && + if (rect->y + rect->height < win_alloc.y + win_alloc.height && gtk_widget_get_vexpand (popover->widget)) rect->height = win_alloc.y + win_alloc.height - rect->y; } @@ -10903,14 +10903,16 @@ gtk_window_activate_menubar (GtkWindow *window, return FALSE; gtk_accelerator_parse (accel, &keyval, &mods); - g_free (accel); if (keyval == 0) { g_warning ("Failed to parse menu bar accelerator '%s'\n", accel); + g_free (accel); return FALSE; } + g_free (accel); + /* FIXME this is wrong, needs to be in the global accel resolution * thing, to properly consider i18n etc., but that probably requires * AccelGroup changes etc. |