[PATCH xwayland 1/2] xwayland: fix memory leak

Marek Chalupa mchqwerty at gmail.com
Mon Nov 23 02:18:14 PST 2015


don't leak memory when realizing window fails

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 hw/xwayland/xwayland.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index e31becf..56b03f6 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -238,6 +238,7 @@ xwl_realize_window(WindowPtr window)
     xwl_window->surface = wl_compositor_create_surface(xwl_screen->compositor);
     if (xwl_window->surface == NULL) {
         ErrorF("wl_display_create_surface failed\n");
+        free(xwl_window);
         return FALSE;
     }
 
-- 
2.5.0



More information about the xorg-devel mailing list