Xinqi Bao's Git

Fixed XCloseDisplay() which is not reached in keyboard_indicators()
authorAaron Marcher <[email protected]>
Mon, 23 Jan 2017 20:01:41 +0000 (21:01 +0100)
committerAaron Marcher <[email protected]>
Mon, 23 Jan 2017 20:01:41 +0000 (21:01 +0100)
slstatus.c

index d29436d..53e1946 100644 (file)
@@ -329,6 +329,7 @@ keyboard_indicators(void)
        Display *dpy = XOpenDisplay(NULL);
        XKeyboardState state;
        XGetKeyboardControl(dpy, &state);
+       XCloseDisplay(dpy);
 
        switch (state.led_mask) {
                case 1:
@@ -343,8 +344,6 @@ keyboard_indicators(void)
                default:
                        return smprintf("");
        }
-
-       XCloseDisplay(dpy);
 }
 
 static char *