[mutter/wip/carlosg/coverity-fixes: 13/13] clutter: Plug leak on error condition
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 13/13] clutter: Plug leak on error condition
- Date: Mon, 25 Oct 2021 09:17:24 +0000 (UTC)
commit c26c2acdcf306f291450b5f763a0a2b0285549b4
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 25 00:18:39 2021 +0200
clutter: Plug leak on error condition
The ClutterContext is leaked if not properly initialized.
CID: #1508079
clutter/clutter/clutter-main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 8d3769e3ae..a2a841c59c 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -619,7 +619,10 @@ clutter_context_new (ClutterBackendConstructor backend_constructor,
clutter_context->last_repaint_id = 1;
if (!clutter_init_real (clutter_context, error))
- return NULL;
+ {
+ g_free (clutter_context);
+ return NULL;
+ }
ClutterCntx = clutter_context;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]