From ad10c5d0cdb8fc3e8eac7181b6af01699132fc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 2 Apr 2014 20:51:41 +0000 Subject: [PATCH] fixed memory leak when using .rpk files with ti99 (nw) --- src/mess/machine/ti99/gromport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mess/machine/ti99/gromport.c b/src/mess/machine/ti99/gromport.c index 083e379f3ef..d8737b56d48 100644 --- a/src/mess/machine/ti99/gromport.c +++ b/src/mess/machine/ti99/gromport.c @@ -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);