mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
Fix various unlikely, but still potential memoryleaks in error code paths
https://bugzilla.gnome.org/show_bug.cgi?id=667311
This commit is contained in:
parent
b11d516c46
commit
95be60de15
6 changed files with 12 additions and 3 deletions
|
@ -372,11 +372,13 @@ GstDiscovererInfo *
|
||||||
gst_discoverer_info_copy (GstDiscovererInfo * ptr)
|
gst_discoverer_info_copy (GstDiscovererInfo * ptr)
|
||||||
{
|
{
|
||||||
GstDiscovererInfo *ret;
|
GstDiscovererInfo *ret;
|
||||||
GHashTable *stream_map = g_hash_table_new (g_direct_hash, NULL);
|
GHashTable *stream_map;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
g_return_val_if_fail (ptr != NULL, NULL);
|
g_return_val_if_fail (ptr != NULL, NULL);
|
||||||
|
|
||||||
|
stream_map = g_hash_table_new (g_direct_hash, NULL);
|
||||||
|
|
||||||
ret = gst_discoverer_info_new ();
|
ret = gst_discoverer_info_new ();
|
||||||
|
|
||||||
ret->uri = g_strdup (ptr->uri);
|
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
|
/* fallback in case iconv implementation doesn't support windows-1252
|
||||||
* for some reason */
|
* for some reason */
|
||||||
if (err->code == G_CONVERT_ERROR_NO_CONVERSION) {
|
if (err->code == G_CONVERT_ERROR_NO_CONVERSION) {
|
||||||
|
g_free (utf8);
|
||||||
utf8 = g_convert (data, size, "UTF-8", "ISO-8859-1", &bytes_read,
|
utf8 = g_convert (data, size, "UTF-8", "ISO-8859-1", &bytes_read,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1166,6 +1166,8 @@ gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset,
|
||||||
if (eclass->send_event)
|
if (eclass->send_event)
|
||||||
eclass->send_event (GST_ELEMENT_CAST (basesrc),
|
eclass->send_event (GST_ELEMENT_CAST (basesrc),
|
||||||
gst_event_new_tag (taglist));
|
gst_event_new_tag (taglist));
|
||||||
|
else
|
||||||
|
gst_tag_list_free (taglist);
|
||||||
src->tags_pushed = TRUE;
|
src->tags_pushed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -644,9 +644,10 @@ gst_smart_encoder_find_elements (GstSmartEncoder * smart_encoder)
|
||||||
|
|
||||||
gst_caps_unref (tmpl);
|
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;
|
ret = GST_STATE_CHANGE_FAILURE;
|
||||||
else
|
} else
|
||||||
smart_encoder->available_caps = res;
|
smart_encoder->available_caps = res;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (smart_encoder, "Done, available_caps:%" GST_PTR_FORMAT,
|
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
|
* on the bus or not. It's not like it's a critical issue regarding
|
||||||
* playsink behaviour. */
|
* playsink behaviour. */
|
||||||
GST_ERROR ("Error converting frame: %s", err->message);
|
GST_ERROR ("Error converting frame: %s", err->message);
|
||||||
|
g_error_free (err);
|
||||||
}
|
}
|
||||||
result = temp;
|
result = temp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,6 +456,8 @@ process_file (GstDiscoverer * dc, const gchar * filename)
|
||||||
g_print ("Analyzing %s\n", uri);
|
g_print ("Analyzing %s\n", uri);
|
||||||
info = gst_discoverer_discover_uri (dc, uri, &err);
|
info = gst_discoverer_discover_uri (dc, uri, &err);
|
||||||
print_info (info, err);
|
print_info (info, err);
|
||||||
|
if (err)
|
||||||
|
g_error_free (err);
|
||||||
gst_discoverer_info_unref (info);
|
gst_discoverer_info_unref (info);
|
||||||
if (st)
|
if (st)
|
||||||
gst_structure_free (st);
|
gst_structure_free (st);
|
||||||
|
|
Loading…
Reference in a new issue