diff --git a/gst/parse/Makefile.am b/gst/parse/Makefile.am index 922740806e..8dd1d9cf6b 100644 --- a/gst/parse/Makefile.am +++ b/gst/parse/Makefile.am @@ -14,7 +14,7 @@ EXTRA_DIST = \ nodist_libgstparse_la_SOURCES = lex.priv_gst_parse_yy.c grammar.tab.c CLEANFILES += grammar.tab.c lex.priv_gst_parse_yy.c -libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS) +libgstparse_la_CFLAGS = $(GST_ALL_CFLAGS) -DYYMALLOC=g_malloc -DYYFREE=g_free libgstparse_la_LIBADD = $(GST_ALL_LIBS) noinst_HEADERS = grammar.tab.h parse_lex.h types.h diff --git a/gst/parse/parse.l b/gst/parse/parse.l index bcd65275c9..97b8ccef62 100644 --- a/gst/parse/parse.l +++ b/gst/parse/parse.l @@ -11,6 +11,22 @@ #include "../gsturi.h" #include "grammar.tab.h" +#ifdef malloc +#undef malloc +#endif + +#ifdef free +#undef free +#endif + +#ifdef realloc +#undef realloc +#endif + +#define malloc g_malloc +#define free g_free +#define realloc g_realloc + /* Override the default ECHO so as to avoid fortify warnings. Ignore the embedded-NUL case for now. We know yytext is NUL-terminated. */ #define ECHO g_fprintf(yyout, "%s", yytext)