sys/: Don't leak the PAR on errors. Fixes #496731.

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.
This commit is contained in:
Tommi Myöhänen 2007-11-16 11:16:58 +00:00 committed by Wim Taymans
parent dffc29eb13
commit 0ccab4d247
3 changed files with 12 additions and 1 deletions

View file

@ -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),

View 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;
}

View 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;