[vlc-commits] XCB/X11: fix long-standing massive leak on error

Rémi Denis-Courmont git at videolan.org
Sun Jul 14 21:44:16 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 14 22:43:42 2013 +0300| [30dbe16aba36da71d8a720ad54438aa389636489] | committer: Rémi Denis-Courmont

XCB/X11: fix long-standing massive leak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=30dbe16aba36da71d8a720ad54438aa389636489
---

 modules/video_output/xcb/x11.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index cd80029..7b0d373 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -406,13 +406,15 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
             break;
         }
     }
+    xcb_flush (sys->conn);
 
     if (count == 0)
         return NULL;
 
     sys->pool = picture_pool_New (count, pic_array);
-    /* TODO release picture resources if NULL */
-    xcb_flush (sys->conn);
+    if (unlikely(sys->pool == NULL))
+        while (count > 0)
+            picture_Release(pic_array[--count]);
     return sys->pool;
 }
 



More information about the vlc-commits mailing list