gst/parse/grammar.y: Apply patch from Sebastien Cote

Original commit message from CVS:
* gst/parse/grammar.y:  Apply patch from Sebastien Cote
<sc5@hermes.usherb.ca> to fix a memleak. (bug #140594)
This commit is contained in:
Sebastien Cote 2004-04-20 19:40:05 +00:00 committed by David Schleef
parent 43b7c6e652
commit 5453269a0e
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2004-04-20 David Schleef <ds@schleef.org>
* gst/parse/grammar.y: Apply patch from Sebastien Cote
<sc5@hermes.usherb.ca> to fix a memleak. (bug #140594)
2004-04-20 Thomas Vander Stichele <thomas at apestaart dot org> 2004-04-20 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstelement.c: (gst_element_wait), * gst/gstelement.c: (gst_element_wait),

View file

@ -793,7 +793,8 @@ yyerror (const char *s)
return -1; 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 * GstElement *
_gst_parse_launch (const gchar *str, GError **error) _gst_parse_launch (const gchar *str, GError **error)
{ {
@ -802,6 +803,7 @@ _gst_parse_launch (const gchar *str, GError **error)
GSList *walk; GSList *walk;
GstBin *bin = NULL; GstBin *bin = NULL;
GstElement *ret; GstElement *ret;
struct yy_buffer_state *buf;
g_return_val_if_fail (str != NULL, NULL); g_return_val_if_fail (str != NULL, NULL);
@ -815,7 +817,7 @@ _gst_parse_launch (const gchar *str, GError **error)
#endif /* __GST_PARSE_TRACE */ #endif /* __GST_PARSE_TRACE */
dstr = g_strdup (str); dstr = g_strdup (str);
_gst_parse_yy_scan_string (dstr); buf = _gst_parse_yy_scan_string (dstr);
#ifndef GST_DISABLE_GST_DEBUG #ifndef GST_DISABLE_GST_DEBUG
yydebug = 1; yydebug = 1;
@ -827,6 +829,7 @@ _gst_parse_launch (const gchar *str, GError **error)
goto error1; goto error1;
} }
g_free (dstr); 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)); 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));