If the !d->display is true, will exit without free memory
block allocate for 'd'.

Signed-off-by: Lim Siew Hoon <[email protected]>
---
 test/putsurface/putsurface_wayland.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/putsurface/putsurface_wayland.c 
b/test/putsurface/putsurface_wayland.c
index b93334d..c3b504f 100644
--- a/test/putsurface/putsurface_wayland.c
+++ b/test/putsurface/putsurface_wayland.c
@@ -207,8 +207,10 @@ open_display(void)
         return NULL;
 
     d->display = wl_display_connect(NULL);
-    if (!d->display)
+    if (!d->display){
+        free(d);
         return NULL;
+    }
 
     wl_display_set_user_data(d->display, d);
     d->registry = wl_display_get_registry(d->display);
-- 
2.1.0

_______________________________________________
Libva mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to