From 5453269a0e2407ce2044effe86d944659f146979 Mon Sep 17 00:00:00 2001 From: Sebastien Cote Date: Tue, 20 Apr 2004 19:40:05 +0000 Subject: [PATCH] gst/parse/grammar.y: Apply patch from Sebastien Cote Original commit message from CVS: * gst/parse/grammar.y: Apply patch from Sebastien Cote to fix a memleak. (bug #140594) --- ChangeLog | 5 +++++ gst/parse/grammar.y | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4dcfa407ff..b124c55508 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-04-20 David Schleef + + * gst/parse/grammar.y: Apply patch from Sebastien Cote + to fix a memleak. (bug #140594) + 2004-04-20 Thomas Vander Stichele * gst/gstelement.c: (gst_element_wait), diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 086a8938ff..11cac7be97 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -793,7 +793,8 @@ yyerror (const char *s) return -1; } -int _gst_parse_yy_scan_string (char*); +struct yy_buffer_state * _gst_parse_yy_scan_string (char*); +void _gst_parse_yy_delete_buffer (struct yy_buffer_state *); GstElement * _gst_parse_launch (const gchar *str, GError **error) { @@ -802,6 +803,7 @@ _gst_parse_launch (const gchar *str, GError **error) GSList *walk; GstBin *bin = NULL; GstElement *ret; + struct yy_buffer_state *buf; g_return_val_if_fail (str != NULL, NULL); @@ -815,7 +817,7 @@ _gst_parse_launch (const gchar *str, GError **error) #endif /* __GST_PARSE_TRACE */ dstr = g_strdup (str); - _gst_parse_yy_scan_string (dstr); + buf = _gst_parse_yy_scan_string (dstr); #ifndef GST_DISABLE_GST_DEBUG yydebug = 1; @@ -827,6 +829,7 @@ _gst_parse_launch (const gchar *str, GError **error) goto error1; } g_free (dstr); + _gst_parse_yy_delete_buffer (buf); GST_CAT_DEBUG (GST_CAT_PIPELINE, "got %u elements and %u links", g.chain ? g_slist_length (g.chain->elements) : 0, g_slist_length (g.links));