sys/: Don't leak the PAR on errors. Fixes #496731.
authorTommi Myöhänen <ext-tommi.myohanen@nokia.com>
Fri, 16 Nov 2007 11:16:58 +0000 (11:16 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 16 Nov 2007 11:16:58 +0000 (11:16 +0000)
Original commit message from CVS:
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_change_state):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get):
Don't leak the PAR on errors. Fixes #496731.

ChangeLog
sys/ximage/ximagesink.c
sys/xvimage/xvimagesink.c

index 3888a72..aeadd28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-16  Wim Taymans  <wim.taymans@gmail.com>
+
+       Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
+
+       * sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
+       (gst_ximagesink_change_state):
+       * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get):
+       Don't leak the PAR on errors. Fixes #496731.
+
 2007-11-16  Tim-Philipp Müller  <tim at centricular dot net>
 
        * gst-libs/gst/tag/gstid3tag.c: (user_tag_matches),
index 1bed764..61ed303 100644 (file)
@@ -1214,6 +1214,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
   if (!px_formats) {
     XCloseDisplay (xcontext->disp);
     g_mutex_unlock (ximagesink->x_lock);
+    g_free (xcontext->par);
     g_free (xcontext);
     return NULL;
   }
index af5b8a7..2e9da9d 100644 (file)
@@ -1645,7 +1645,6 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
   GST_DEBUG_OBJECT (xvimagesink, "X reports %dx%d pixels and %d mm x %d mm",
       xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
 
-
   gst_xvimagesink_calculate_pixel_aspect_ratio (xcontext);
   /* We get supported pixmap formats at supported depth */
   px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
@@ -1653,6 +1652,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
   if (!px_formats) {
     XCloseDisplay (xcontext->disp);
     g_mutex_unlock (xvimagesink->x_lock);
+    g_free (xcontext->par);
     g_free (xcontext);
     GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS,
         ("Could not initialise Xv output"), ("Could not get pixel formats"));
@@ -1690,6 +1690,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
   if (!xcontext->caps) {
     XCloseDisplay (xcontext->disp);
     g_mutex_unlock (xvimagesink->x_lock);
+    g_free (xcontext->par);
     g_free (xcontext);
     /* GST_ELEMENT_ERROR is thrown by gst_xvimagesink_get_xv_support */
     return NULL;