diff --git a/epan/dtd_grammar.lemon b/epan/dtd_grammar.lemon index 5b5bc24c84..0a3a19d80b 100644 --- a/epan/dtd_grammar.lemon +++ b/epan/dtd_grammar.lemon @@ -96,7 +96,7 @@ doctype ::= TAG_START DOCTYPE_KW NAME(Name) OPEN_BRACKET dtd_parts CLOSE_BRACKET if(bd->proto_root) g_free(bd->proto_root); - bd->proto_root = g_strdup(Name->text); + bd->proto_root = Name->text; g_strdown(bd->proto_name); diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index 9539345d37..d57ae355f2 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -337,6 +337,8 @@ extern dtd_build_data_t* dtd_parse(GString* s) { yyrestart(NULL); + if (location) g_free(location); + location = NULL; DtdParseFree(pParser, g_free );