Commit 95be60de authored by Havard Graff's avatar Havard Graff Committed by Tim-Philipp Müller

Fix various unlikely, but still potential memoryleaks in error code paths

https://bugzilla.gnome.org/show_bug.cgi?id=667311
parent b11d516c
......@@ -372,11 +372,13 @@ GstDiscovererInfo *
gst_discoverer_info_copy (GstDiscovererInfo * ptr)
{
GstDiscovererInfo *ret;
GHashTable *stream_map = g_hash_table_new (g_direct_hash, NULL);
GHashTable *stream_map;
GList *tmp;
g_return_val_if_fail (ptr != NULL, NULL);
stream_map = g_hash_table_new (g_direct_hash, NULL);
ret = gst_discoverer_info_new ();
ret->uri = g_strdup (ptr->uri);
......
......@@ -501,6 +501,7 @@ gst_tag_freeform_string_to_utf8 (const gchar * data, gint size,
/* fallback in case iconv implementation doesn't support windows-1252
* for some reason */
if (err->code == G_CONVERT_ERROR_NO_CONVERSION) {
g_free (utf8);
utf8 = g_convert (data, size, "UTF-8", "ISO-8859-1", &bytes_read,
NULL, NULL);
}
......
......@@ -1166,6 +1166,8 @@ gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset,
if (eclass->send_event)
eclass->send_event (GST_ELEMENT_CAST (basesrc),
gst_event_new_tag (taglist));
else
gst_tag_list_free (taglist);
src->tags_pushed = TRUE;
}
......
......@@ -644,9 +644,10 @@ gst_smart_encoder_find_elements (GstSmartEncoder * smart_encoder)
gst_caps_unref (tmpl);
if (gst_caps_is_empty (res))
if (gst_caps_is_empty (res)) {
gst_caps_unref (res);
ret = GST_STATE_CHANGE_FAILURE;
else
} else
smart_encoder->available_caps = res;
GST_DEBUG_OBJECT (smart_encoder, "Done, available_caps:%" GST_PTR_FORMAT,
......
......@@ -2867,6 +2867,7 @@ gst_play_sink_convert_frame (GstPlaySink * playsink, GstCaps * caps)
* on the bus or not. It's not like it's a critical issue regarding
* playsink behaviour. */
GST_ERROR ("Error converting frame: %s", err->message);
g_error_free (err);
}
result = temp;
}
......
......@@ -456,6 +456,8 @@ process_file (GstDiscoverer * dc, const gchar * filename)
g_print ("Analyzing %s\n", uri);
info = gst_discoverer_discover_uri (dc, uri, &err);
print_info (info, err);
if (err)
g_error_free (err);
gst_discoverer_info_unref (info);
if (st)
gst_structure_free (st);
......
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