Commit 0f180098 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

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.
parent b603027d
2008-02-11 Sebastian Dröge <slomo@circular-chaos.org>
* 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.
2008-02-11 Sebastian Dröge <slomo@circular-chaos.org>
* ext/gconf/gconf.c: (gst_gconf_render_bin_with_default):
......
common @ 05a617c9
Subproject commit 961bb6bd997d7c8da6058534e86b4a1361c0fcea
Subproject commit 05a617c9043ddb78f8578195b18c166d7e1d4c2e
......@@ -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;
......
......@@ -74,6 +74,7 @@ GST_START_TEST (test_multifilesink)
fail_if (mfs == NULL);
mfs_pattern = g_build_filename (my_tmpdir, "%05d", NULL);
g_object_set (G_OBJECT (mfs), "location", mfs_pattern, NULL);
g_object_unref (mfs);
run_pipeline (pipeline);
gst_object_unref (pipeline);
......@@ -117,6 +118,8 @@ GST_START_TEST (test_multifilesrc)
fail_if (mfs == NULL);
mfs_pattern = g_build_filename (my_tmpdir, "%05d", NULL);
g_object_set (G_OBJECT (mfs), "location", mfs_pattern, NULL);
g_free (mfs_pattern);
g_object_unref (mfs);
run_pipeline (pipeline);
gst_object_unref (pipeline);
......@@ -129,6 +132,7 @@ GST_START_TEST (test_multifilesrc)
fail_if (mfs == NULL);
mfs_pattern = g_build_filename (my_tmpdir, "%05d", NULL);
g_object_set (G_OBJECT (mfs), "location", mfs_pattern, NULL);
g_object_unref (mfs);
run_pipeline (pipeline);
gst_object_unref (pipeline);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment