[mutter/wip/carlosg/coverity-fixes: 12/13] cogl: Plug leak in error path
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 12/13] cogl: Plug leak in error path
- Date: Tue, 26 Oct 2021 12:39:10 +0000 (UTC)
commit c869b92d5d2f8a7a67fafcb01130685c759da70b
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Oct 25 00:05:41 2021 +0200
cogl: Plug leak in error path
If the renderer fails to connect, we were leaking the renderer.
CID: #1505882
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>
cogl/cogl/cogl-context.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c
index 7ff9f050bb..25fdfa7fac 100644
--- a/cogl/cogl/cogl-context.c
+++ b/cogl/cogl/cogl-context.c
@@ -146,6 +146,7 @@ cogl_context_new (CoglDisplay *display,
CoglRenderer *renderer = cogl_renderer_new ();
if (!cogl_renderer_connect (renderer, error))
{
+ cogl_object_unref (renderer);
g_free (context);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]