gl-renderer: Avoid double-free on init failure

If gl-renderer fails its initialisation, we return to compositor
teardown, which will try to free the renderer if ec->renderer was set.
This is unfortunate when we've already torn it down whilst failing
gl-renderer init, so just clear the renderer member so we don't try to
tear down twice.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Emil Velikov <emil.velikov@collabora.com>
dev
Daniel Stone 5 years ago
parent 6d2e73b314
commit d76947b666
  1. 1
      libweston/renderer-gl/gl-renderer.c

@ -3596,6 +3596,7 @@ fail_terminate:
eglTerminate(gr->egl_display);
fail:
free(gr);
ec->renderer = NULL;
return -1;
}

Loading…
Cancel
Save