From 98fe6c24afa830d9707b0c8e8c41b93fb75845a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Mon, 15 Sep 2014 09:15:29 +0200 Subject: 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. --- src/xinerama.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xinerama.c') 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 -- cgit v1.2.3