ecore_wayland: fix dereference null pointer while creating ecore_wl_subsurf 03/49403/1
authorGwanglim Lee <gl77.lee@samsung.com>
Tue, 13 Oct 2015 05:17:35 +0000 (14:17 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 13 Oct 2015 05:17:35 +0000 (14:17 +0900)
Change-Id: I4c3a80a3bcdd8aac7a0911b1f6e60a6a0ad0fafd

src/lib/ecore_wayland/ecore_wl_subsurf.c

index f34febf..990a6d2 100644 (file)
@@ -34,6 +34,7 @@ ecore_wl_subsurf_create(Ecore_Wl_Window *win)
    struct wl_surface *surface;
    Ecore_Wl_Subsurf *ess;
    struct wl_subcompositor *subcomp;
+   struct wl_compositor *wlcomp;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -43,7 +44,10 @@ ecore_wl_subsurf_create(Ecore_Wl_Window *win)
    subcomp = _ecore_wl_subcompositor_get();
    if (!subcomp) return NULL;
 
-   surface = wl_compositor_create_surface(_ecore_wl_compositor_get());
+   wlcomp = _ecore_wl_compositor_get();
+   if (!wlcomp) return NULL;
+
+   surface = wl_compositor_create_surface(wlcomp);
    if (!surface)
      return NULL;