wavparse: Fix memory leak in wavparse element

Fixing of leaking the text field of the GstWavParseNote and
GstWavParseLabl structure.

https://bugzilla.gnome.org/show_bug.cgi?id=785429
This commit is contained in:
Deepak Srivastava 2017-08-10 15:14:31 +05:30 committed by Sebastian Dröge
parent f2372b46bc
commit 059420b678

View file

@ -193,6 +193,22 @@ gst_wavparse_class_init (GstWavParseClass * klass)
"Erik Walthinsen <omega@cse.ogi.edu>");
}
static void
gst_wavparse_notes_free (GstWavParseNote * note)
{
if (note)
g_free (note->text);
g_free (note);
}
static void
gst_wavparse_labls_free (GstWavParseLabl * labl)
{
if (labl)
g_free (labl->text);
g_free (labl);
}
static void
gst_wavparse_reset (GstWavParse * wav)
{
@ -233,8 +249,11 @@ gst_wavparse_reset (GstWavParse * wav)
g_list_free_full (wav->cues, g_free);
wav->cues = NULL;
if (wav->labls)
g_list_free_full (wav->labls, g_free);
g_list_free_full (wav->labls, (GDestroyNotify) gst_wavparse_labls_free);
wav->labls = NULL;
if (wav->notes)
g_list_free_full (wav->notes, (GDestroyNotify) gst_wavparse_notes_free);
wav->notes = NULL;
if (wav->caps)
gst_caps_unref (wav->caps);
wav->caps = NULL;