diff options
-rw-r--r-- | src/game.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -238,6 +238,10 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr) NULL); goto name_err; name_ok: + if (game->name != NULL) { + free(game->name); + game->name = NULL; + } game->xml_parsing = DB_GAME_XML_PARSING_NAME; db_xml_node_push(p, game, _db_game_xml_invalid_start, _db_game_xml_name_end, @@ -259,6 +263,10 @@ _db_game_xml_game_el_start(void *pv, const char *name, const char **attr) NULL); goto desc_err; desc_ok: + if (game->desc != NULL) { + free(game->desc); + game->desc = NULL; + } game->xml_parsing = DB_GAME_XML_PARSING_DESCRIPTION; db_xml_node_push(p, game, _db_game_xml_invalid_start, _db_game_xml_description_end, |