diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-03-17 11:01:50 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-03-17 11:01:50 (EDT) |
commit | aaa24157f390ae5ec0a3d8ce221faba2db903cb1 (patch) | |
tree | 1f9994e684e8a9051878e066fccf5670d13fb405 /src | |
parent | 8028e0c5f7c56c4932de1e9a60a9e99b79d65803 (diff) | |
download | dodge-balls-aaa24157f390ae5ec0a3d8ce221faba2db903cb1.zip dodge-balls-aaa24157f390ae5ec0a3d8ce221faba2db903cb1.tar.gz dodge-balls-aaa24157f390ae5ec0a3d8ce221faba2db903cb1.tar.bz2 |
game: Free old name/description when replacing
Diffstat (limited to 'src')
-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, |