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>
This commit is contained in:
Daniel Stone 2020-02-03 20:01:21 +00:00
parent 6d2e73b314
commit d76947b666
1 changed files with 1 additions and 0 deletions

View File

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