From e067b30a1ef92bf2d4bca2618c663c7d3669e233 Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Fri, 17 Jan 2014 14:00:18 -0800 Subject: [PATCH] rpi: free renderer if we bail early during create Signed-off-by: U. Artie Eoff --- src/rpi-renderer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c index c6b924c..5642b4f 100644 --- a/src/rpi-renderer.c +++ b/src/rpi-renderer.c @@ -1742,11 +1742,13 @@ rpi_renderer_create(struct weston_compositor *compositor, renderer->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (renderer->egl_display == EGL_NO_DISPLAY) { weston_log("failed to create EGL display\n"); + free(renderer); return -1; } if (!eglInitialize(renderer->egl_display, &major, &minor)) { weston_log("failed to initialize EGL display\n"); + free(renderer); return -1; } @@ -1761,6 +1763,7 @@ rpi_renderer_create(struct weston_compositor *compositor, EGL_EXTENSIONS); if (!extensions) { weston_log("Retrieving EGL extension string failed.\n"); + free(renderer); return -1; } -- 2.7.4