From 02c3706c5b243d2daac9babfd00d533e9c2c8ef1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Feb 2011 16:40:19 +0100 Subject: [PATCH] * xterm.c (x_set_frame_alpha): Access data before it is free:d. Make sure we don't do x_catch_errors twice. --- src/ChangeLog | 5 +++++ src/xterm.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 68a12d4f55a..ba3bbb71b7e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-02-11 Jan Djärv + + * xterm.c (x_set_frame_alpha): Access data before it is free:d. + Make sure we don't do x_catch_errors twice. + 2011-02-10 Glenn Morris * Makefile.in (really-lwlib): Depend on globals.h, for parallel builds. diff --git a/src/xterm.c b/src/xterm.c index 31f002fa05c..52d79e8dad7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -488,17 +488,16 @@ x_set_frame_alpha (struct frame *f) if (rc == Success && actual != None) { + unsigned long value = *(unsigned long *)data; XFree ((void *) data); - if (*(unsigned long *)data == opac) + if (value == opac) { x_uncatch_errors (); return; } } - x_uncatch_errors (); } - x_catch_errors (dpy); XChangeProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opac, 1L); -- 2.39.5