* xterm.c (x_set_frame_alpha): Access data before it is free:d.
authorJan Djärv <jan.h.d@swipnet.se>
Fri, 11 Feb 2011 15:40:19 +0000 (16:40 +0100)
committerJan Djärv <jan.h.d@swipnet.se>
Fri, 11 Feb 2011 15:40:19 +0000 (16:40 +0100)
Make sure we don't do x_catch_errors twice.

src/ChangeLog
src/xterm.c

index 68a12d4..ba3bbb7 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-11  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * 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  <rgm@gnu.org>
 
        * Makefile.in (really-lwlib): Depend on globals.h, for parallel builds.
index 31f002f..52d79e8 100644 (file)
@@ -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);