summaryrefslogtreecommitdiffstats
path: root/gst/multifile
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-02-11 14:01:52 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-02-11 14:01:52 +0000
commit0f180098a193507b3ec936314d3a789c6b60dbbb (patch)
treea3ae0ed77519e6c7553ea016f4de59a63ed7fe44 /gst/multifile
parentb603027de797e7e2b5afaf01afd369db2178ce7f (diff)
Close some memory leaks spotted by the unit test. Fixes bug #515697.
Original commit message from CVS: * gst/multifile/gstmultifilesrc.c: (gst_multi_file_src_create): * tests/check/elements/multifile.c: (GST_START_TEST): Close some memory leaks spotted by the unit test. Fixes bug #515697.
Diffstat (limited to 'gst/multifile')
-rw-r--r--gst/multifile/gstmultifilesrc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c
index 47cfad36..dfd1520f 100644
--- a/gst/multifile/gstmultifilesrc.c
+++ b/gst/multifile/gstmultifilesrc.c
@@ -285,6 +285,8 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
/* If we've read at least one buffer successfully, not finding the
* next file is EOS. */
g_free (filename);
+ if (error != NULL)
+ g_error_free (error);
return GST_FLOW_UNEXPECTED;
} else {
goto handle_error;
@@ -296,6 +298,7 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = (unsigned char *) data;
+ GST_BUFFER_MALLOCDATA (buf) = GST_BUFFER_DATA (buf);
GST_BUFFER_SIZE (buf) = size;
GST_BUFFER_OFFSET (buf) = multifilesrc->offset;
GST_BUFFER_OFFSET_END (buf) = multifilesrc->offset + size;
@@ -310,12 +313,15 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
handle_error:
{
- switch (errno) {
- default:{
- GST_ELEMENT_ERROR (multifilesrc, RESOURCE, READ,
- ("Error while reading from file \"%s\".", filename),
- ("%s", g_strerror (errno)));
- }
+ if (error != NULL) {
+ GST_ELEMENT_ERROR (multifilesrc, RESOURCE, READ,
+ ("Error while reading from file \"%s\".", filename),
+ ("%s", error->message));
+ g_error_free (error);
+ } else {
+ GST_ELEMENT_ERROR (multifilesrc, RESOURCE, READ,
+ ("Error while reading from file \"%s\".", filename),
+ ("%s", g_strerror (errno)));
}
g_free (filename);
return GST_FLOW_ERROR;