clutter: Plug leak on error condition

The ClutterContext is leaked if not properly initialized.

CID: #1508079
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>
This commit is contained in:
Carlos Garnacho 2021-10-25 00:18:39 +02:00
parent c869b92d5d
commit 90ad8b88d4

View File

@ -619,7 +619,10 @@ clutter_context_new (ClutterBackendConstructor backend_constructor,
clutter_context->last_repaint_id = 1; clutter_context->last_repaint_id = 1;
if (!clutter_init_real (clutter_context, error)) if (!clutter_init_real (clutter_context, error))
return NULL; {
g_free (clutter_context);
return NULL;
}
ClutterCntx = clutter_context; ClutterCntx = clutter_context;