Blob Blame History Raw
From 3cf2688a63946ba5b6c37b6950596255e1471e38 Mon Sep 17 00:00:00 2001
From: Aaron Plattner <aplattner@nvidia.com>
Date: Fri, 18 Mar 2016 16:00:05 -0700
Subject: [PATCH] st: Fix offscreen leak if cogl_framebuffer_allocate fails

If cogl_framebuffer_allocate fails in _st_create_shadow_pipeline_from_actor, the
CoglOffscreen* that was allocated earlier in the function is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=735705

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
---
 src/st/st-private.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/st/st-private.c b/src/st/st-private.c
index f48e1a5..6a0c128 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -445,6 +445,7 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
       if (!cogl_framebuffer_allocate (fb, &catch_error))
         {
           cogl_error_free (catch_error);
+          cogl_object_unref (offscreen);
           cogl_object_unref (buffer);
           return NULL;
         }
-- 
2.7.3