rpi: free renderer if we bail early during create

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
This commit is contained in:
U. Artie Eoff 2014-01-17 14:00:18 -08:00 committed by Kristian Høgsberg
parent 2e2384aac5
commit e067b30a1e

View File

@ -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;
}