fixed memory leak when using .rpk files with ti99 (nw)

This commit is contained in:
Oliver Stöneberg 2014-04-02 20:51:41 +00:00
parent 6ca98a6b70
commit ad10c5d0cd

View File

@ -2312,7 +2312,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
zip_file* zipfile;
char *layout_text = NULL;
xml_data_node *layout_xml;
xml_data_node *layout_xml = NULL;
xml_data_node *romset_node;
xml_data_node *configuration_node;
xml_data_node *resources_node;
@ -2428,6 +2428,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
catch (rpk_exception &exp)
{
newrpk->close();
if (layout_xml != NULL) xml_file_free(layout_xml);
if (zipfile != NULL) zip_file_close(zipfile);
if (layout_text != NULL) global_free_array(layout_text);
@ -2435,6 +2436,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
throw exp;
}
if (layout_xml != NULL) xml_file_free(layout_xml);
if (zipfile != NULL) zip_file_close(zipfile);
if (layout_text != NULL) global_free_array(layout_text);