[mutter/wip/carlosg/coverity-fixes: 11/12] cogl: Plug leak in error path
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/coverity-fixes: 11/12] cogl: Plug leak in error path
- Date: Mon, 25 Oct 2021 13:45:58 +0000 (UTC)
commit 8fd3bb53de53467367bebce4bba143773d1fc79a
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
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]