summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index 75238f3..be3d40d 100644
--- a/src/game.c
+++ b/src/game.c
@@ -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,