On 23/11/15 11:18, Marek Chalupa wrote:
don't leak memory when realizing window fails

Signed-off-by: Marek Chalupa <[email protected]>
---
  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;
      }

While at it, I think we should also check for calloc() returned value just above for xwl_window.

Cheers,
Olivier
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to