diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2015-04-29 10:08:20 +0300 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2015-04-29 10:08:20 +0300 |
commit | 06e94bc9aeaf183fb4bef1929255e6ee133bc826 (patch) | |
tree | df7a745a346ae0e94f82aca6f5fd1afd0999e104 | |
parent | 0d7b35d5b3416e66f135969062e9a0d9d2752283 (diff) |
fix possible leak
-rw-r--r-- | client/X11/xf_monitor.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index 96e58bd..7ede960 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -109,15 +109,18 @@ tbool xf_detect_monitors(xfInfo* xfi, rdpSettings* settings) if (oi->connection == RR_Connected) { ci = XRRGetCrtcInfo(xfi->display, screen_resources, oi->crtc); - if (ci != NULL && count < 16) + if (ci != NULL) { - vscreen->monitors[count].area.left = ci->x; - vscreen->monitors[count].area.top = ci->y; - vscreen->monitors[count].area.right = ci->x + ci->width - 1; - vscreen->monitors[count].area.bottom = ci->y + ci->height - 1; - vscreen->monitors[count].primary = output == primary_output; + if (count < 16) + { + vscreen->monitors[count].area.left = ci->x; + vscreen->monitors[count].area.top = ci->y; + vscreen->monitors[count].area.right = ci->x + ci->width - 1; + vscreen->monitors[count].area.bottom = ci->y + ci->height - 1; + vscreen->monitors[count].primary = output == primary_output; + count++; + } XRRFreeCrtcInfo(ci); - count++; } } XRRFreeOutputInfo(oi); |