summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-09-15 09:15:29 +0200
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-09-15 09:20:11 +0200
commit98fe6c24afa830d9707b0c8e8c41b93fb75845a4 (patch)
tree3f30aa55202aacda69909fca8db192459116050a
parent28d044cc6e7513135b860d09076c04c1a01a3493 (diff)
downloadratpoison-98fe6c24afa830d9707b0c8e8c41b93fb75845a4.zip
Plug memory leak in xinerama
If there is only one Xinerama screen we do not care about Xinerama but we should still free resources we just obtained.
-rw-r--r--src/xinerama.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xinerama.c b/src/xinerama.c
index cfa6efb..f037b05 100644
--- a/src/xinerama.c
+++ b/src/xinerama.c
@@ -61,9 +61,13 @@ init_xinerama(void)
}
xine_screens = XineramaQueryScreens(dpy, &xine_screen_count);
- if ((xine_screens == NULL) || (xine_screen_count < 2)) {
+ if (xine_screens == NULL) {
return;
}
+ if (xine_screen_count < 2) {
+ XFree (xine_screens);
+ return;
+ }
rp_have_xinerama = 1;
#else